diff --git a/README.md b/README.md index 6aa715c..e463524 100755 --- a/README.md +++ b/README.md @@ -84,6 +84,7 @@ yarn add prism-react-renderer ```jsx import React from "react"; import { render } from "react-dom"; +// import { createRoot } from "react-dom/client"; import Highlight, { defaultProps } from "prism-react-renderer"; const exampleCode = ` @@ -95,7 +96,7 @@ const exampleCode = ` return () => ; `; -render( +const Content = ( {({ className, style, tokens, getLineProps, getTokenProps }) => (
@@ -108,9 +109,13 @@ render(
         ))}
       
)} -
, - document.getElementById('root') + ); +render(Content, document.getElementById('root')); + +// If you are using React 18 +// const root = createRoot(document.getElementById('root')); +// root.render(Content); ``` `` is the only component exposed by this package, as inspired by