Commit f883690
feat: memoize components to prevent child re-renders (vercel#45)
* chore(markdown): memoize components to prevent child re-renders
This PR memoizes Markdown components to prevent re-renders in children. I'll include a video.
Start as draft.
Note: This fix doesn't solve `anchor` because of how `hardern-react-markdown` works.
* changeset
* Draft section
* Revert "Draft section"
This reverts commit df4c3ac.
* fix: remove unused 'node' prop from MemoLi component
* fix imports
* feat: add ImageComponent to components export and update memoization for Markdown elements
- Introduced `ImageComponent` for handling images in Markdown.
- Updated memoization for various Markdown elements to improve performance.
- Cleaned up import statements for consistency.
* fix: update image component to use MemoImg for improved performance
- Replaced `ImageComponent` with `MemoImg` in the components export.
- This change enhances memoization for image handling in Markdown.
* Change streamdown version and memoize components
Updated streamdown version from patch to minor and added feature to memoize components.
---------
Co-authored-by: Hayden Bleasel <hello@haydenbleasel.com>1 parent 963f01d commit f883690
File tree
2 files changed
+353
-139
lines changed- .changeset
- packages/streamdown/lib
2 files changed
+353
-139
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
0 commit comments