professional-work

09

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.

preview
값이 같을 때 툴바 상태를 유지하는 설명용 도식 / Illustrative diagram of keeping toolbar state when values match

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.