From ae02ffdffdba3616ce9bf6751b16a66f5f8affa0 Mon Sep 17 00:00:00 2001 From: Ayc0 Date: Tue, 21 May 2024 16:22:18 +0200 Subject: [PATCH] add re-renders --- src/components/page-react-timings/App.tsx | 29 ++++++++++++++++------- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/src/components/page-react-timings/App.tsx b/src/components/page-react-timings/App.tsx index 59add50..0b8a5b5 100644 --- a/src/components/page-react-timings/App.tsx +++ b/src/components/page-react-timings/App.tsx @@ -349,10 +349,16 @@ const examples = { function: ExampleWithFunction, }; +function resetConsole() { + console.clear(); + i = 65; +} + export default function App() { const [example, setExample] = React.useState( null ); + const [, forRerender] = React.useState({}); const Example: (() => JSX.Element) | undefined = examples[example!]; const [withTimings, setTiming] = React.useState(false); @@ -369,8 +375,7 @@ export default function App() { + {Object.keys(examples).map((example) => (