Version 2.0.0
14 Aug, 2022
This is a major release with lots of new features, plenty of bugfixes, significant internal rewrite and, therefore, some breaking changes.
What's new
New features
EditorState
Now the form component and its state are separate. This will allow for the component to be used as a library in other Node projects.- Schema validation
Schema will be validated for errors while new form component is created. - File uploads
New keyword calledhandlerhas been added for file uploads. Use this to provide the URL endpoint where files will be uploaded to. - New APIs for browser component
APIs for controlling the form component in the browser such as handling change events and dynamically updating the schema. - Exception reporter for browser component
New exception reporter will now display schema errors in the browser. Currently, it's primitive but will evolve in future. - Docs, Live demos, Interactive playground
https://bhch.github.io/react-json-form/.
Bugfixes
- #32: Display help text under "Select file" button (of
file-urlfield). - #33: If default value for integer type was
0, it was being overwritten bynull. - #34: Make multiselect widget work on top level arrays.
- #35: Boolean type will be
nullby default. Earlier, the default for boolean wasfalse. - #36: Make select input respect falsy values.
- #37: Add support for
date-time(from the standard spec) as an alias fordatetime. - #39: Respect
minItemswhen creating or syncing arrays.
Breaking changes
Main Form component (src/form.js)
If you directly use the Form component (such as in Node projects), the following notes are for you.
- Renamed
Formcomponent toReactJSONForm. - Removed
fileListEndpointandfileUploadEndpointprops. Now usefileHandlerprop instead. - The form component will requires two compulsory props:
state(instance ofEditorState) andonChange(a callback function for handling the changes). - Boolean type will be
nullby default. Earlier, the default for boolean wasfalse.
Browser component (src/renderer.js)
If you use the component in the browser (and not in Node projects), the following notes are for you
- Removed
JsonFormfunction which was used for creating the form component in browsers. Instead use the newcreateFormfunction. - Removed
uidconfig option. - Removed
fileListEndpointandfileUploadEndpointconfig options. Use the newfileHandleroption which serves the purpose of both.