Skip to content

Commit

Permalink
memoize
Browse files Browse the repository at this point in the history
  • Loading branch information
jakzaizzat committed Apr 27, 2024
1 parent 7e8fbda commit 65f3df3
Showing 1 changed file with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,14 @@ export function SortableTokenGrid({
return rows * (size + GAP) - GAP - rows * GAP; // Subtract GAP to remove the extra gap after the first and last row
}, [items.length, columns, size]);

const style = useMemo<ViewProps['style']>(() => {
return {
height: containerHeight,
};
}, [containerHeight]);

return (
<View
style={{
height: containerHeight,
}}
>
<View style={style}>
{items.map((item) => (
<SortableToken
key={item.id}
Expand Down

0 comments on commit 65f3df3

Please sign in to comment.