From 5db15b6ec7cd41cc15214f4448b064f4dd11f974 Mon Sep 17 00:00:00 2001 From: Jarred Sumner Date: Fri, 20 Aug 2021 13:17:57 -0700 Subject: demos -> examples Former-commit-id: 19a5d395bd41b0a0b854cdf749eb96149f91cbe1 --- .../src/components/RenderCounter.tsx | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 examples/react-fast-refresh-test/src/components/RenderCounter.tsx (limited to 'examples/react-fast-refresh-test/src/components/RenderCounter.tsx') diff --git a/examples/react-fast-refresh-test/src/components/RenderCounter.tsx b/examples/react-fast-refresh-test/src/components/RenderCounter.tsx new file mode 100644 index 000000000..ed2f00b56 --- /dev/null +++ b/examples/react-fast-refresh-test/src/components/RenderCounter.tsx @@ -0,0 +1,21 @@ +import React from "react"; + +export function RenderCounter({ name, children }) { + const counter = React.useRef(1); + return ( +
+
+
+ {name} rendered {counter.current++} times +
+
+ LAST RENDER:{" "} + {new Intl.DateTimeFormat([], { + timeStyle: "long", + }).format(new Date())} +
+
+
{children}
+
+ ); +} -- cgit v1.2.3