Proper way to integrate a client-side only component? #10377
-
I need to integrate an editor (needs document object) into my Remix app. I got it working, but it still raises an error in the console.
This is my code:
And the
So, what am I missing to prevent the console error? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Render it inside ClientOnly from Remix Utils. If just by importing it cause the error then also re-export it from a Also |
Beta Was this translation helpful? Give feedback.
Render it inside ClientOnly from Remix Utils.
If just by importing it cause the error then also re-export it from a
.client.ts
file.Also
const editorComponent = lazy(() => import("./EditorComponent"));
must happen outside the component, not inside.