I have an typescript error passing Prism as a prop to Highlight. This happens on both Prism imported from prismjs and the exported Prism from prism-react-renderer
Error:
Type 'typeof import("./node_modules/@types/prismjs/index")' is not assignable to type 'PrismLib'.
Types of property 'languages' are incompatible.
Type 'Languages' is not assignable to type 'LanguagesDict'.
'string' index signatures are incompatible.
Type 'Grammar' is not assignable to type 'PrismGrammar'.
Type 'GrammarRest' is not assignable to type 'PrismGrammar'.
Index signature for type 'string' is missing in type 'GrammarRest'.ts(2322)
Hey! 👋
I have an typescript error passing
Prism
as a prop toHighlight
. This happens on both Prism imported fromprismjs
and the exported Prism fromprism-react-renderer
Error:
Reproducible sandbox: https://codesandbox.io/s/sweet-fire-jmfge6?file=/src/App.tsx
Please let me know if you need more info, or if I have missed something :)