Skip to content

Commit

Permalink
refactor: demo grid response items change (#1650)
Browse files Browse the repository at this point in the history
  • Loading branch information
PeachScript authored May 11, 2023
1 parent 7b0a3fd commit 45b9054
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/client/theme-api/DumiDemoGrid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,10 @@ export const DumiDemoGrid: FC<IDumiDemoGridProps> = (props) => {
const handler = () => setCols(generator(fm, props.items));

window.addEventListener('resize', handler);
handler();

return () => window.removeEventListener('resize', handler);
}, []);
}, [props.items, fm.demo]);

return (
<div style={{ display: 'flex', margin: -8 }} data-dumi-demo-grid>
Expand Down

0 comments on commit 45b9054

Please sign in to comment.