YYsuni / react18-json-view

JSON viewer for react18
https://jv.yysuni.com/
MIT License
236 stars 15 forks source link

How do I set a strict type allowed for customizeNode #35

Open sbolla2 opened 4 months ago

sbolla2 commented 4 months ago

Say I want to make sure when a specific node is edited, its type remains unchanged (for example, boolean -> boolean: true -> false), so I shouldn't be able to change its type into a string, number, object, null, or array. How can I customize options for this, is it possible?

YYsuni commented 4 months ago

For now, node changes only emit onEdit/onChange event, and you can't prevent the edition. But, you could revert it and warn user for it, onEdit event will provide some useful params.

hrodriguezv commented 3 months ago

I'm trying to integrate this component into an application and everything works fine except when editing. In the onEdit event the value that should come in newValue variable, is coming in undefined. Is there any additional configuration I need to do to fix this behavior?

YYsuni commented 3 months ago

hrodriguezv

Can you provide some code demo or gif/mp4?