-
Notifications
You must be signed in to change notification settings - Fork 194
[RSC - client directive] : Not working has expected #423
-
Hi, first thank you for this amazing repository ❤️ .
contentlayer has been really useful to me lately.
TLDR : Should i expect contentlayer to handle React Component with client directive inside MDX ?
I want to use contentlayer to hold all my content (mdx files)
The stack is :
nextJS 13contentlayertailwind
Here is a repo with the stack : https://github.com/Stephane-Pires/contentlayer-mdx-client-directive
I started with MDX using @next/mdx (commit : 1ef8551c6206eb44f0f1717f2f8c32eef7da22d0) , everything was working fine, i was able to import Component with and without use client directive directly inside my mdx files. (Below a gif of the working <Counter /> Button)
file : https://github.com/Stephane-Pires/contentlayer-mdx-client-directive/blob/main/content/hello.mdx
Screen.Recording.2023年04月16日.at.18.58.20.mov
Then i tryied MDX using @contentlayer & @next-contentlayer(commit : a3c027e455de3fda8b329ad2e2113b0c38c042e4)
-
I configured
contentlayer -
Removed the
<Counter />component from the MDX -
generate the
.contentlayerwith the CLInpx contentlayer builddue to No.contentlayerfolder is generated in Next.js 13.3 #415 (i think)
Screenshot 2023年04月16日 at 19 08 00
Everything is working has expected.
Things started to go off track when i added the <Counter /> component inside MDX files.
I tryied :
- commit : 4761f0852b87a30de8de554e5155d3b3cc00015b
- commit : 353b94051bc2b1b5d6d55d6e290ad3c389776ed9
From my understanding so far, contentlayer could handle Client Component
https://github.com/contentlayerdev/contentlayer/releases
Note: While it's theoretically also possible to use Contentlayer combined with the 'use client' approach, we don't recommend it as it massively increases page sizes and thus the page load time.
My question is : Should i expect contentlayer to handle React Component with client directive inside MDX ?
P.S : I really want to use contentlayer the types generation is a big plus for me !
Thanks for reading !
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 1 comment
-
Possibly related to this #309 (comment)
Beta Was this translation helpful? Give feedback.