You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+62Lines changed: 62 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -255,6 +255,68 @@ See [Next.js on Netlify](https://docs.netlify.com/integrations/frameworks/next-j
255
255
256
256
## Frequently Asked Questions
257
257
258
+
### How can I add a custom MDX component?
259
+
260
+
Here's an example on how to create a donut chart from Chart.js (assumingyoualreadyhavethedependenciesinstalled) and use it in MDX posts. First, create a new `DonutChart.tsx` component in `components`:
Since the underlying `Doughnut` component uses React hooks, we add the `'use client'` directive to specify that it is a client side component. Also, there is an existing issue which prevents named components from being used, so we need to export the component as the default export.
0 commit comments