Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prism type not assignable to PrismLib prop type #203

Closed
smartmike opened this issue May 4, 2023 · 1 comment
Closed

Prism type not assignable to PrismLib prop type #203

smartmike opened this issue May 4, 2023 · 1 comment

Comments

@smartmike
Copy link

Hey! 👋

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)

Reproducible sandbox:
https://codesandbox.io/s/sweet-fire-jmfge6?file=/src/App.tsx

image

Please let me know if you need more info, or if I have missed something :)

@carloskelly13
Copy link
Contributor

Good catch, we'll get this fixed up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants