Skip to content

How to use Renderers in latest react-markdown version? #1240

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

You must be logged in to vote

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

To answer your implied question of: "how can I support a table of contents?"
Use plugins instead of components: https://github.com/remarkjs/remark-toc with https://github.com/rehypejs/rehype-slug or https://github.com/rehypejs/rehype-autolink-headings
Using components or renderers will make your problem more complex than it needs to be.

To answer your direct question "How to use Renderers in latest react-markdown version?"
You migrate, this is explained at length in the changelog https://github.com/remarkjs/react-markdown/blob/main/changelog.md#change-renderers-to-components

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by himat
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