-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
To create a custom component, I followed the FAQ from the repo - “custom-mdx-component”. And I get the following error - Server is reporting that use client does not appear in the file, which is incorrect: “ useRef only works in Client Components. Add the "use client" directive at the top of the file to use it”
To Reproduce
Steps to reproduce the behavior:
- I added
DonutChart.tsxfile to the components folder, - I inserted
use clientto the1st line of the file to make the component a React Client Component so thatuseRefis allowed - in the last line of
DonutChart.tsxI exported the custom component -export default DonutChart, - Added component to
MDXComponents.tsx - Created MDX file to use DonutChart
Expected behavior
Expect custom component - DonutChart to render in the MDX page without error
Screenshots
What I should see -
Test component file -
Error message - runtime error
System Info (if dev / build issue):
- OS: MacOS
- Node version 18.5.0
- Npm version 9.2.0
Browser Info (if display / formatting issue):
- Device [e.g. Desktop, iPhone6]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]
Additional context
Add any other context about the problem here.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working