next-mdx icon indicating copy to clipboard operation
next-mdx copied to clipboard

Render inlineCode and code

Open emilianoyaryura opened this issue 4 years ago • 2 comments

is there an option to separate code and inlineCode in the components? Here's my code:

const components = { h1: ({ children }) => { return <Heading as="h1">{children}</Heading>; } code: ({ children }) => { return <p sx={{ color: "blue", background: 'red' }}>{children}</p>; }, inlineCode: ({ children }) => { return <p sx={{ color: "red", background: 'yellow' }}>{children}</p>; } };

const content = useHydrate(doc, { components: components, });

emilianoyaryura avatar May 21 '21 15:05 emilianoyaryura

This doesn't work.. it only render the code for both: `` and ``````

emilianoyaryura avatar May 21 '21 15:05 emilianoyaryura

Hmm I can't reproduce this. See https://6ezyv.sse.codesandbox.io/blog/hello-world

Can you take a look at this codesandbox: https://codesandbox.io/s/immutable-cookies-6ezyv?file=/pages/blog/%5B...slug%5D.js

shadcn avatar May 21 '21 16:05 shadcn