Skip to content

Commit b63a70c

Browse files
chore(runway): cherry-pick fix: cp-7.47.0 Prevent unnecessary re-renders when using Snaps forms (#15978)
- fix: cp-7.47.0 Prevent unnecessary re-renders when using Snaps forms (#15976)
1 parent 2f3df83 commit b63a70c

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

  • app/components/Snaps/SnapUIRenderer

app/components/Snaps/SnapUIRenderer/utils.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,12 @@ function getChildrenForHash(component: JSXElement) {
7373
return null;
7474
}
7575

76+
// Prevent re-rendering when rendering forms, we don't care what children it contains
77+
// since we can identify it by its name.
78+
if (component.type === 'Form') {
79+
return null;
80+
}
81+
7682
const { children } = component.props;
7783

7884
// Field has special handling to determine the primary child to use for the key

0 commit comments

Comments
 (0)