Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Add defaultContent to JSONEditor #24

Closed
wants to merge 1 commit into from

Conversation

tylerlaws0n
Copy link

This will allow react or other frameworks to initialize the editor with content and still recieve
updated content through onChange, but not continue to control the value as it is changed.

Relates to #23

This will allow react or other frameworks to initialize the editor with content and still recieve
updated content through onChange, but not continue to control the value as it is changed.
@tylerlaws0n
Copy link
Author

tylerlaws0n commented Oct 12, 2021

@josdejong would really appreciate your feedback on this when you get a chance - Thank you!

@josdejong
Copy link
Owner

Why isn't the current content property sufficient for this? You decide what you pass there, and whether you want to update this property or not.

@josdejong
Copy link
Owner

I do like the "build:watch": "npm run package -- --watch" that you added 😁

@tylerlaws0n
Copy link
Author

Very good point with regards to the value. What I found is probably better for this situation is to edit the sandbox to accept the prop on the react side, then have it not update, leaving the editor uncontrolled.

https://codesandbox.io/s/svelte-jsoneditor-react-forked-td9to

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants