Can I use Lexical with Remix? #7623
-
Hey, I stumbled upon this issue in the lexical repo and was wondering if this changes with v2. Is it possible to use Lexical with Remix? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 8 replies
-
Typically with components that don't really support SSR, you would wrap that in a First create a lexical.client.tsx file and re-export all the lexical functions // components/lexical.client.tsx
export * from 'lexical'
export * from '@lexical/react' Then in your route, import // routes/editor.tsx
import { ClientOnly } from 'remix-utils'
import { LexicalComposer } from '~/components/lexical.client'
export default Component() {
return (
<ClientOnly fallback={<p>Loading</p>}>
{() => (
<LexicalComposer>
//...
</LexicalComposer>
)}
</ClientOnly>
)
} |
Beta Was this translation helpful? Give feedback.
-
@rodolphoasb did you figure this one out? @kiliman's solution doesn't work because there's no export from |
Beta Was this translation helpful? Give feedback.
Typically with components that don't really support SSR, you would wrap that in a
<ClientOnly>
component fromremix-utils
First create a lexical.client.tsx file and re-export all the lexical functions
Then in your route, import
ClientOnly
and your lexical components