@mrmeg/expo-ui 0.3.0 → 0.4.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.
@@ -1,7 +1,13 @@
1
+ import { Platform } from "react-native";
1
2
  // Web font stack fallback
2
3
  const WEB_FONT_STACK = "system-ui, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\"";
3
- const isReactNativeRuntime = typeof navigator !== "undefined" && navigator.product === "ReactNative";
4
- const isWebRuntime = typeof document !== "undefined" && !isReactNativeRuntime;
4
+ // IMPORTANT: do NOT key these on `typeof document` / `typeof navigator`.
5
+ // On a web bundle, Node SSR sees `undefined` for both and the client sees them,
6
+ // producing different snapshot values at module load -> hydration mismatch on
7
+ // every <StyledText>. `Platform.OS` (from react-native-web) returns "web" in
8
+ // both environments, so the value is stable.
9
+ const isWebRuntime = Platform.OS === "web";
10
+ const isReactNativeRuntime = Platform.OS !== "web";
5
11
  const serifFamilies = isWebRuntime
6
12
  ? { regular: "Georgia, 'Times New Roman', serif", bold: "Georgia, 'Times New Roman', serif" }
7
13
  : { regular: "Georgia", bold: "Georgia" };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mrmeg/expo-ui",
3
- "version": "0.3.0",
3
+ "version": "0.4.0",
4
4
  "private": false,
5
5
  "description": "Reusable Expo and React Native UI primitives for MrMeg projects.",
6
6
  "keywords": [