You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For example, an image component rendered inside the header slot re-renders whenever content inside the default zone changes.
The children subtree (default zone) appears stable and does not fully re-render, while the slot subtree always does.
Is this expected behavior for root slots in Puck? And is there a recommended workaround to preserve/memoize slot subtree renders so unrelated updates do not trigger re-renders?
Observe that the slot subtree re-renders even though the slot content itself did not change.
What happens
Components rendered inside the root slot subtree re-render on every unrelated editor update, including default-zone content updates and unrelated field changes.
This causes unnecessary renders and performance issues for heavier slot content.
What I expect to happen
Root slot content should remain stable and avoid re-rendering when unrelated parts of the editor update.
Ideally, slot subtrees should preserve/memoize renders unless their own content changes.
Description
I’m seeing a performance issue where anything rendered inside a root slot re-renders whenever:
Example configuration:
For example, an image component rendered inside the
headerslot re-renders whenever content inside the default zone changes.The
childrensubtree (default zone) appears stable and does not fully re-render, while the slot subtree always does.Is this expected behavior for root slots in Puck? And is there a recommended workaround to preserve/memoize slot subtree renders so unrelated updates do not trigger re-renders?
Environment
0.21.218.3.1Next.js 15.5.15WindowsSteps to reproduce
root.render:Add a component inside the
headerslot.Update any field inside the default zone.
Observe that the slot subtree re-renders even though the slot content itself did not change.
What happens
Components rendered inside the root slot subtree re-render on every unrelated editor update, including default-zone content updates and unrelated field changes.
This causes unnecessary renders and performance issues for heavier slot content.
What I expect to happen
Root slot content should remain stable and avoid re-rendering when unrelated parts of the editor update.
Ideally, slot subtrees should preserve/memoize renders unless their own content changes.
Additional Media
puck-root-slot.mp4