1
0
mirror of https://github.com/phuoc-ng/csslayout.git synced 2025-08-05 21:57:32 +02:00

Don't refresh products on sidebar

This commit is contained in:
Phuoc Nguyen
2021-03-31 16:20:04 +07:00
parent c6973507c9
commit 28998e445e

View File

@@ -20,8 +20,7 @@ interface DetailsLayoutProps {
const DetailsLayout: React.FC<DetailsLayoutProps> = ({ pattern, children }) => {
useDocumentTitle(`CSS Layout ∙ ${pattern}`);
const products = randomItems(ProductList, 3);
const products = React.useMemo(() => randomItems(ProductList, 3), []);
return (
<Layout>