From 10c1169529019962b049a2b64dbcf901eb3d6e6a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciej=20Jastrze=CC=A8bski?= Date: Thu, 30 Jan 2025 19:45:36 +0100 Subject: [PATCH 1/2] . --- examples/web-vite/src/TestList.tsx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/examples/web-vite/src/TestList.tsx b/examples/web-vite/src/TestList.tsx index 8671067..874acfa 100644 --- a/examples/web-vite/src/TestList.tsx +++ b/examples/web-vite/src/TestList.tsx @@ -19,11 +19,11 @@ interface ListItemProps { } const ListItem = ({ title }: ListItemProps) => { - // Uncomment to introduce a performance issue - // const [, forceRender] = React.useState(); - // React.useEffect(() => { - // forceRender({}); - // }, [title]); + // Intentionally causing an extra re-render + const [, forceRender] = React.useState(); + React.useEffect(() => { + forceRender({}); + }, [title]); return (
From 8d8e5e9ec1415fce3ce017f7d535086a0118e3da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciej=20Jastrze=CC=A8bski?= Date: Fri, 31 Jan 2025 14:11:43 +0100 Subject: [PATCH 2/2] . --- examples/web-vite/src/TestList.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/examples/web-vite/src/TestList.tsx b/examples/web-vite/src/TestList.tsx index 874acfa..23e1df3 100644 --- a/examples/web-vite/src/TestList.tsx +++ b/examples/web-vite/src/TestList.tsx @@ -1,3 +1,5 @@ +import React from 'react'; + interface TestListProps { count: number; }