Skip to content

[react-markdown] getting error Type '(instance: HTMLElement | null) => void' is not assignable to type '(instance: SyntaxHighlighter | null) => void' #817

Discussion options

You must be logged in to vote

@vinuthakaranth could you share a runnable example of what you are seeing?
It looks like this is based off https://github.com/remarkjs/react-markdown#use-custom-components-syntax-highlight
and trying that out in a code sandbox with TypeScript, it appears to work https://codesandbox.io/s/determined-ellis-9iqvb

It's possible you have a different highlighter that has TypeScript typings already instead of react-syntax-highlighter.
If so, it may be related to #815 and the {...props} spread not being compatible with the properties of the <SyntaxHighlighter> component.

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Answer selected by ChristianMurphy
Comment options

You must be logged in to vote
1 reply
@ChristianMurphy
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
☂️ area/types This affects typings
2 participants