Skip to content

Hoist ToolbarButton to module scope in RichContentEditor - #1014

Merged
RUKAYAT-CODER merged 1 commit into
rinafcode:mainfrom
Chinonso-Peter:main
Jul 27, 2026
Merged

Hoist ToolbarButton to module scope in RichContentEditor#1014
RUKAYAT-CODER merged 1 commit into
rinafcode:mainfrom
Chinonso-Peter:main

Conversation

@Chinonso-Peter

@Chinonso-Peter Chinonso-Peter commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Closes #975


Hoist ToolbarButton from inside the RichContentEditor component body to module scope with an extracted ToolbarButtonProps interface. This prevents the component from getting a new identity on every re-render, which was causing all toolbar buttons to remount on each keystroke.

ToolbarButton was declared inside the component body, giving it a new
component identity on every re-render and causing all toolbar buttons to
remount on each keystroke. Hoist it to module scope with an extracted
ToolbarButtonProps interface to give it a stable identity.
@drips-wave

drips-wave Bot commented Jul 27, 2026

Copy link
Copy Markdown

@Chinonso-Peter Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@Chinonso-Peter

Copy link
Copy Markdown
Contributor Author

@RUKAYAT-CODER please review

@RUKAYAT-CODER

Copy link
Copy Markdown
Contributor

Thank you for contributing to the project.

@RUKAYAT-CODER
RUKAYAT-CODER merged commit 54d4f49 into rinafcode:main Jul 27, 2026
6 of 7 checks passed
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

Successfully merging this pull request may close these issues.

Hoist or memoize RichContentEditor ToolbarButton

2 participants