mdx - achingachris/reactecommerce GitHub Wiki


title: MDX! date: "2019-10-22" description: "A post showing MDX in action"

import Button from "src/components/button"

This is a post showing MDX in action. This starter now comes with MDX out-of-the-box!

// you can write JSX in your Markdown!
<button>test</button>

test

Custom components

You can also import custom React components locally. Make sure gatsby-plugin-root-import as relative paths will not work.

// Import custom component
import Button from "src/components/button"
<Button>Test</Button>

Test

MDX

MDX lets you write JSX embedded inside markdown, perfect for technical blogs. MDX works with Gatsby through gatsby-plugin-mdx. You can learn more about it in the Gatsby docs: Getting Started with MDX.

⚠️ **GitHub.com Fallback** ⚠️