FormidableLabs / prism-react-renderer

🖌️ Renders highlighted Prism output to React (+ theming & vendored Prism)
MIT License
1.88k stars 153 forks source link

page fails to render #228

Closed ttasovac closed 2 months ago

ttasovac commented 1 year ago

I have installed prism-react-renderer with:

npm install prism-react-renderer

Then in a component, I do:

import Highlight, { defaultProps } from "prism-react-renderer";

So far so good, no errors.

But when I try to test syntax highlighting from the same component with:

const CodeBlock = `
<p>Test.</p> 
`

<Highlight language="html" code={CodeBlock}></Highlight>

I still get no errors in the console (success Re-building development bundle), but I get a blank page in the browser.

Any idea what could be going wrong or how to troubleshoot this? Many thanks in advance.

carbonrobot commented 9 months ago

Do you have errors in the browser console? Can you post a reproduceable example?