react-jsonschema-form-codemirror-widget
v1.0.2
Published
codemirror widget for react-jsonschema-form
Downloads
11
Maintainers
Readme
Example
import React from 'react'
import { CodeMirrorWidgetJavascript, CodeMirrorWidgetJSON } from 'react-jsonschema-form-codemirror-widget'
import Form from "react-jsonschema-form"
class MyForm extends React.Component {
render() {
const schema = {
title: "Blog",
type: "object",
properties: {
codeMirrorJavascript: {type: "string"},
codeMirrorJSON: {type: "string"}
}
}
const uiSchema = {
codeMirrorJavascript: {
"ui:widget": "codeMirrorJavascript"
},
codeMirrorJSON: {
"ui:widget": "codeMirrorJSON"
}
}
return <Form
widgets={{codeMirrorJavascript: CodeMirrorWidgetJavascript, codeMirrorJSON: CodeMirrorWidgetJSON}}
schema={schema}
uiSchema={uiSchema}
/>
}
}