From 8ea3dbeac5b7fb59c12d87731838d4fcf6c0300d Mon Sep 17 00:00:00 2001 From: Asher Gomez Date: Tue, 13 May 2025 07:28:46 +1000 Subject: [PATCH] refactor(www): use `useSignal()` instead of `useState()` (#2894) --- .../client-side-components-and-libraries.md | 11 +++++----- www/islands/TableOfContents.tsx | 7 ++++--- www/islands/ThemeToggle.tsx | 20 ++++++++----------- 3 files changed, 18 insertions(+), 20 deletions(-) diff --git a/docs/latest/examples/client-side-components-and-libraries.md b/docs/latest/examples/client-side-components-and-libraries.md index 8cc42763..0224881c 100644 --- a/docs/latest/examples/client-side-components-and-libraries.md +++ b/docs/latest/examples/client-side-components-and-libraries.md @@ -53,7 +53,7 @@ function LeafletProvider(props: { children: ComponentChildren }) {

Leaflet must be loaded on the client. No children will render

); } - const [value, setValue] = useState(null); + const value = useSignal(null) return ( <> {/* Load Leaflet CSS */} @@ -65,7 +65,7 @@ function LeafletProvider(props: { children: ComponentChildren }) { /> {/* Load Leaflet JS */}