A lightweight react json editor based on codemirror, providing smart prompts and verification based on json-schema
npm install json-schema-enhanced-editor-reactjson-schema-enhanced-editor-react is a lightweight json editor based on react & codemirror, providing smart prompts and verification based on json-schema.
``tsx
import { JSONSchema7 } from "json-schema";
import { Editor } from "json-schema-enhanced-editor-react";
export function JSONSchemaInputDemo() {
const [value, setValue] = useState
return (
onChange={(value) => {
if (!value) return setValue(null);
try {
const result = JSON.parse(value) as object;
if (result) {
setValue(result);
}
} catch (e) {
// _
}
}}
schema={schema as unknown as JSONSchema7}
height={height}
/>
);
}
``