Fetching markdoc props inside the next app router #462
Replies: 2 comments
-
I don't believe you can access However, if you need to access the values passed to the @bradlc have you ran into this? Do you have other suggestions? |
Beta Was this translation helpful? Give feedback.
-
This is a hard blocker for me as well. Previously using pages building Tables of Contents, headings sidebars, etc. was quite easy. Now it's quite problematic! I wonder if it'd be possible to change the nextjs plugin's exported code to use a React Context to store this information and make it available to parent components? |
Beta Was this translation helpful? Give feedback.
-
What happened?
This issue is with
@markdoc/nextjs
.In the pages router, we have the ability to get access to some markdoc properties via pageProps which we can use it to build const components like table of contents etc...
Example:
How to get access to those properties in app router.
To reproduce
This is not a bug but a needed feature that is available in pages router but not in app router. This makes the ability to migrate from pages router to app router difficult.
Version
0.3.4
Additional context
No response
Beta Was this translation helpful? Give feedback.
All reactions