react18-json-view icon indicating copy to clipboard operation
react18-json-view copied to clipboard

How do I set a strict type allowed for customizeNode

Open sbolla2 opened this issue 1 year ago • 3 comments

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?

sbolla2 avatar Feb 21 '24 08:02 sbolla2

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.

YYsuni avatar Feb 21 '24 10:02 YYsuni

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?

hrodriguezv avatar Mar 12 '24 16:03 hrodriguezv

hrodriguezv

Can you provide some code demo or gif/mp4?

YYsuni avatar Mar 13 '24 06:03 YYsuni