1. 14
    Embed React Components in our Markdown with MDX in a Next.js App
    4m 54s

Embed React Components in our Markdown with MDX in a Next.js App

Share this video with your friends

Send Tweet

When rendering our markdown we might want to enrich the experience with some dynamic content. Many static site generators allow to include dynamic content placeholders for like embedding a Youtube video, generating table of contents, code blocks with interactive functionality and more. One way to achieve this in the React ecosystem is by using MDX. MDX is similar to JSX but for Markdown content, and allows us to directly embed React components within it. This gives an enourmous flexibility to what we can display within a page.

In this lesson we’re going to generate a new Nx library to host our “mdx elements” and learn how to leverage the MDXRemote component to embed these React components into our markdown rendering flow.