Skip to content

Commit

Permalink
Fix destructure
Browse files Browse the repository at this point in the history
  • Loading branch information
FrederikBolding committed Jun 18, 2024
1 parent 9eca52f commit f797264
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions ui/components/app/snaps/snap-ui-renderer/snap-ui-renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,15 @@ const SnapUIRendererComponent = ({
getSnapMetadata(state, snapId),
);

const {
state: initialState,
context,
content,
} = useSelector(
const interfaceState = useSelector(
(state) => getMemoizedInterface(state, interfaceId),
// We only want to update the state if the content has changed.
// We do this to avoid useless re-renders.
(oldState, newState) => isEqual(oldState.content, newState.content),
);

const content = interfaceState?.content;

// sections are memoized to avoid useless re-renders if one of the parents element re-renders.
const sections = useMemo(
() =>
Expand All @@ -68,6 +66,8 @@ const SnapUIRendererComponent = ({
);
}

const { state: initialState, context } = interfaceState;

return (
<SnapDelineator
snapName={snapName}
Expand Down

0 comments on commit f797264

Please sign in to comment.