Replies: 2 comments 1 reply
-
try change your second try with following code: import { useEffect } from "react"
export default function Editor({ id }) {
useEffect(() => {
const { default: EditorJS } = await import("@editorjs/editorjs");
const editor = new EditorJS({
holder: id,
})
}, [])
return (
<div id={id} />
)
} |
Beta Was this translation helpful? Give feedback.
-
If there is someone still there, I spent 2 days on it figuring it out, as I tried Here is the behavior that works perfectly on both dev and production for me, so that you don't struggle on it anymore. The module On the root file I load the script of editor.js
Later on, I transfer the class to another variable to prevent overlapping with the namespace (the class is
in global.d.ts at the root of the project (if it does not exist create a new file)
I have a function that takes cares of the creation process for me
In the component that handles edition i make sure it only happen on the client side: ` const [init, setInit] = useState(false);
` That's it ! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello there,
I'm trying to get Editor.js to work within a Remix app without success yet.
I'm looking for some help in order to get it work.
I've tried several alternatives which are all in the same repo.
First try: using
react-editor-js
The code is available on branch
react-editor-js
on the repo.This does nothing more than displaying an empty
div
. No errors displayed anywhere.Second try: using Editor.js directly
The code is available on branch
editor.js
on the repo.I encounter errors during build time:
If anyone could provide some help with any working solution, it would be wonderful.
Thanks in advance.
Beta Was this translation helpful? Give feedback.
All reactions