Closed aholeye closed 12 months ago
It works! Thank you.
I'm sorry, there is still an issue. When I copy the demo according to the documentation, it works fine. However, when I add a prop mode={Mode.text}, the issue still persists. like this:
<JSONEditorReact
content={jsonContent}
onChange={handler}
mode={Mode.text}
/>
After some testing, I have noticed an even stranger phenomenon. Even declaring useState(Mode.tree)
within the page causes the same issue.
like this:
const [mode, setMode] = useState(Mode.tree)
even if I haven't used that variable.
I guess importing Mode
to use Mode.tree
pulls in the whole library, which gives an issue when rendering server side. You can use the string 'text'
instead if that makes life easier. Otherwise, you'll have to import Mode
with a dynamic import too.
But, the page is displaying correctly.