How to inject "use client" directive #2570
Unanswered
wereHamster
asked this question in
Q&A
Replies: 1 comment
-
To directly address your question: Yes, you could definitely create a recma plugin that injects the The counter question is: Should you? MDX files typically contain a lot of text content that benefits from SSR. This likely comes up, because you’re pointing |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Is there a way to inject a "use client" directive at the top of the module that mdx-js compiler generates? Either via something in the .mdx file itself or via a plugin.
The "use client" directive is required when the
providerImportSource
option points to a React hook (which are not allowed in React Server Components).Beta Was this translation helpful? Give feedback.
All reactions