Skip to content

Property 'code' does not exist on type 'ClassAttributes<HTMLElement> & HTMLAttributes<HTMLElement> & ExtraProps' #1311

Answered by ChristianMurphy
erayerdin asked this question in Q&A
Discussion options

You must be logged in to vote

Welcome @erayerdin!
Sorry you ran into a spot of trouble.

I assume you are running react-markdown on version 9?
If TypeScript is correctly erroring, none of those properties exist, the actual properties are https://github.com/remarkjs/react-markdown?tab=readme-ov-file#components

For a better sense of what you want to achieve, see the code highlighting example https://github.com/remarkjs/react-markdown?tab=readme-ov-file#use-custom-components-syntax-highlight and map those properties into your code highlighting component of choice.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by ChristianMurphy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants