professional-work
Lexical — refining an existing toolbar's state updates
I used a Lexical editor built by another developer and made limited toolbar changes. I kept previous state when values matched and removed an unnecessary listener to avoid redundant updates and renders.
Keeping state unchanged when its values match
I tried a React-based Lexical editor built by another developer, read its plugins and toolbar structure, and made limited changes. The work involved refining an existing implementation.
Editor events were repeatedly updating the toolbar with the same values. Creating a new state object even when nothing changed could trigger another render.
I changed the update to return the previous object when values matched, removed an unnecessary update listener, and organized default color constants. These changes let the toolbar avoid redundant state updates and renders.