@tamagui/core 1.96.0 → 1.97.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/native.js CHANGED
@@ -8394,20 +8394,24 @@ var require_Theme_native = __commonJS({
8394
8394
  });
8395
8395
  } catch {
8396
8396
  }
8397
- return process.env.NODE_ENV === "development" && props.debug === "visualize" && (finalChildren = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ThemeDebug.ThemeDebug, {
8397
+ process.env.NODE_ENV === "development" && props.debug === "visualize" && (finalChildren = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ThemeDebug.ThemeDebug, {
8398
8398
  themeState,
8399
8399
  themeProps: props,
8400
8400
  children: finalChildren
8401
- })), getThemedChildren(themeState, finalChildren, props, isRoot);
8401
+ }));
8402
+ var stateRef = (0, import_react3.useRef)({
8403
+ hasEverThemed: !1
8404
+ });
8405
+ return getThemedChildren(themeState, finalChildren, props, isRoot, stateRef);
8402
8406
  });
8403
8407
  Theme.displayName = "Theme";
8404
8408
  Theme.avoidForwardRef = !0;
8405
8409
  function getThemedChildren(themeState, children, props) {
8406
- var isRoot = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : !1, themeManager = themeState.themeManager, isNewTheme = themeState.isNewTheme;
8410
+ var isRoot = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : !1, stateRef = arguments.length > 4 ? arguments[4] : void 0, themeManager = themeState.themeManager, isNewTheme = themeState.isNewTheme;
8407
8411
  if (!themeManager)
8408
8412
  throw new Error(process.env.NODE_ENV === "development" ? "\u274C No theme found, either incorrect name, potential duplicate tamagui deps, or TamaguiProvider not providing themes." : "\u274C 005");
8409
- var shallow = props.shallow, forceClassName = props.forceClassName, hasEverThemed = (0, import_react3.useRef)(!1), shouldRenderChildrenWithTheme = isNewTheme || props.inverse || hasEverThemed.current || forceClassName || isRoot;
8410
- if (shouldRenderChildrenWithTheme && (hasEverThemed.current = !0), !shouldRenderChildrenWithTheme)
8413
+ var shallow = props.shallow, forceClassName = props.forceClassName, shouldRenderChildrenWithTheme = isNewTheme || "inverse" in props || "theme" in props || stateRef.current.hasEverThemed || forceClassName || isRoot;
8414
+ if (shouldRenderChildrenWithTheme && (stateRef.current.hasEverThemed = !0), !shouldRenderChildrenWithTheme)
8411
8415
  return children;
8412
8416
  var next = children;
8413
8417
  shallow && (next = import_react3.Children.toArray(children).map(function(child) {
@@ -9690,7 +9694,7 @@ If you meant to do this, you can disable this warning - either change untilMeasu
9690
9694
  if (groupName && subGroupContext && (content = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ComponentContext.ComponentContext.Provider, _object_spread_props(_object_spread2({}, componentContext), {
9691
9695
  groups: subGroupContext,
9692
9696
  children: content
9693
- }))), process.env.NODE_ENV === "development" && time && time(_templateObject19()), content = disableTheme ? content : (0, import_Theme.getThemedChildren)(themeState, content, themeStateProps, !1), process.env.NODE_ENV === "development" && time && time(_templateObject20()), process.env.NODE_ENV === "development" && props.debug === "visualize" && (content = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ThemeDebug.ThemeDebug, {
9697
+ }))), process.env.NODE_ENV === "development" && time && time(_templateObject19()), content = disableTheme ? content : (0, import_Theme.getThemedChildren)(themeState, content, themeStateProps, !1, stateRef), process.env.NODE_ENV === "development" && time && time(_templateObject20()), process.env.NODE_ENV === "development" && props.debug === "visualize" && (content = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ThemeDebug.ThemeDebug, {
9694
9698
  themeState,
9695
9699
  themeProps: props,
9696
9700
  children: content