@usecross/docs 0.12.0 → 0.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/dist/ssr.js +18 -7
- package/dist/ssr.js.map +1 -1
- package/package.json +1 -1
- package/src/components/ThemeProvider.tsx +5 -0
- package/src/ssr.tsx +5 -2
package/dist/index.js
CHANGED
|
@@ -630,6 +630,10 @@ function ThemeProvider({
|
|
|
630
630
|
function useTheme() {
|
|
631
631
|
const context = useContext(ThemeContext);
|
|
632
632
|
if (!context) {
|
|
633
|
+
if (typeof window === "undefined") {
|
|
634
|
+
return { theme: "system", resolvedTheme: "light", setTheme: () => {
|
|
635
|
+
} };
|
|
636
|
+
}
|
|
633
637
|
throw new Error("useTheme must be used within a ThemeProvider");
|
|
634
638
|
}
|
|
635
639
|
return context;
|