diff --git a/examples/kendo-react-e-commerce-astro-app/src/components/Header.tsx b/examples/kendo-react-e-commerce-astro-app/src/components/Header.tsx index 36e2f567..d93e660c 100644 --- a/examples/kendo-react-e-commerce-astro-app/src/components/Header.tsx +++ b/examples/kendo-react-e-commerce-astro-app/src/components/Header.tsx @@ -84,19 +84,20 @@ const Header: React.FC = () => { ); const [theme, setTheme] = useState( - () => - typeof window !== "undefined" - ? localStorage.getItem("theme") || - "https://unpkg.com/@progress/kendo-theme-default@10.0.0/dist/default-main.css" - : "https://unpkg.com/@progress/kendo-theme-default@10.0.0/dist/default-main.css" + "https://unpkg.com/@progress/kendo-theme-default@10.0.0/dist/default-main.css" ); + useEffect(() => { + const storedTheme = localStorage.getItem("theme"); + if (storedTheme) { + setTheme(storedTheme); + } + }, []); + useEffect(() => { const themeLink = document.getElementById("theme-link") as HTMLLinkElement; if (themeLink) { themeLink.href = theme; - } else { - console.error("Theme tag not found"); } }, [theme]); diff --git a/examples/kendo-react-e-commerce-astro-app/src/pages/index.astro b/examples/kendo-react-e-commerce-astro-app/src/pages/index.astro index 595184ed..99161ec2 100644 --- a/examples/kendo-react-e-commerce-astro-app/src/pages/index.astro +++ b/examples/kendo-react-e-commerce-astro-app/src/pages/index.astro @@ -1,14 +1,14 @@ --- import Layout from '../layouts/Layout.astro'; -import Home from '../components/Home'; import Header from '../components/Header'; +import Home from '../components/Home'; import Footer from '../components/Footer'; --- -
+
- +
-