JSONEditor can now be used as a controlled component
See original GitHub issue@vankop I think you will like the latest release of the jsoneditor, v5.20.1
, which allows using it as a controlled component in a framework like React. There are two new methods update(json)
and updateText
for this, and two new callback methods onChangeText
and onChangeJSON
(checkout the docs for details).
You can find two react examples in the examples
folder for inspiration:
https://github.com/josdejong/jsoneditor/tree/master/examples/react_demo https://github.com/josdejong/jsoneditor/tree/master/examples/react_advanced_demo
It would be great if you could update jsoneditor-react
to utilize this new functionality, and I would love to hear your feedback on whether it all works smooth or if you encounter issues.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:6
- Comments:17 (3 by maintainers)
Top Results From Across the Web
jsoneditor-react-controlled - npm
Start using jsoneditor-react-controlled in your project by running `npm i ... You can use react-imported-component or your own implementation.
Read more >Wrapping an external library as a controlled component with ...
I'm trying to make a thin wrapper to the "jsoneditor" library using a functionnal component. I'm rather new to React and worked so...
Read more >JSON Editor - Contentstack
Using Contentstack Custom Fields, you can now input a JSON text into an entry field. With the JSON Editor custom field, you can...
Read more >New Features in XMLSpy XML and JSON Editor - Altova
Once a schema is installed, it's available for use with any Altova ... XMLSpy users can now easily customize the display of the...
Read more >Legacy Builder - Documentation - Prismic
Copy-paste the JSON code from the JSON editor and place it in the ... The type will now appear with the Active Custom...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
For anyone else who does not have time to take a new repo under their belt, this was my work-around to get controlled mostly working with the current version:
Awesome thanks @josdejong that component worked well, this one doesn’t update when the value changes