-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
How to implement Editor.js in nextjs? #1790
Comments
I am facing the same thing, have you got the solution? |
NextJS is running that server-side, that's why it doesn't work. Throw a useEffect there, and set a state on mount. That'll only be executed client-side, and show when that state is true. |
In my search I found this recent medium article on this. |
Thank you, that looks very helpful |
Yep. Unfortunately the same code is working for me. My code: import dynamic from 'next/dynamic';
const EditorJs = dynamic(import('react-editor-js'), {
ssr: false,
loading: () => <p>Loading ...</p>,
});
const Editor = () => {
return (
<>
<EditorJs />
</>
);
};
export default Editor; Stackblitz Link: https://stackblitz.com/edit/nextjs-mckpbw?file=pages/editor.js |
Following a bit of that example, I've created a repository with a fully working editor.js in Next.js. |
How to implement Editor.js in nextjs?
I tried to implement Editor.js in Nextjs but I failed to do it.
Here is my code.
Error:
Can someone help me to implement EditorJs in NextJs?
Code: https://stackblitz.com/edit/nextjs-mckpbw?devtoolsheight=33&file=pages/editor.js
The text was updated successfully, but these errors were encountered: