Skip to content

SD-3092 - fix: toolbar serialization for stable rendering#3248

Merged
harbournick merged 1 commit into
mainfrom
gabriel/sd-3092-bug-template-builder-remounts-when-toolbar-prop-is-an-object
May 14, 2026
Merged

SD-3092 - fix: toolbar serialization for stable rendering#3248
harbournick merged 1 commit into
mainfrom
gabriel/sd-3092-bug-template-builder-remounts-when-toolbar-prop-is-an-object

Conversation

@chittolinag
Copy link
Copy Markdown
Contributor

@chittolinag chittolinag commented May 12, 2026

Issue

Passing an inline object to the toolbar prop caused SuperDocTemplateBuilder to rebuild SuperDoc on every parent re-render, looping infinitely. The reason for that is that useMemo compared the object dep by reference (Object.is), so every time the parent re-renders, this would look like the toolbar also changed.

Proposed solution

Use JSON.stringify(toolbar) as the dep (same pattern as stableTelemetry in the same file).

@chittolinag chittolinag requested a review from a team as a code owner May 12, 2026 15:56
@linear
Copy link
Copy Markdown

linear Bot commented May 12, 2026

SD-3092

Copy link
Copy Markdown
Collaborator

@harbournick harbournick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@harbournick harbournick merged commit f14f6eb into main May 14, 2026
14 checks passed
@harbournick harbournick deleted the gabriel/sd-3092-bug-template-builder-remounts-when-toolbar-prop-is-an-object branch May 14, 2026 22:48
@superdoc-bot
Copy link
Copy Markdown
Contributor

superdoc-bot Bot commented May 14, 2026

🎉 This PR is included in template-builder v1.7.0-next.5

The release is available on GitHub release

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants