@underverse-ui/underverse 1.0.204 → 1.0.205

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.
@@ -1864,16 +1864,19 @@ var TranslationProvider = ({ children, locale = "en", translations, i18n }) => {
1864
1864
  },
1865
1865
  [locale, translations]
1866
1866
  );
1867
- return /* @__PURE__ */ jsx2(GlobalI18nProvider, { i18n, children: /* @__PURE__ */ jsx2(TranslationContext.Provider, { value: { locale, t }, children }) });
1867
+ const value = React2.useMemo(() => ({ locale, t }), [locale, t]);
1868
+ return /* @__PURE__ */ jsx2(GlobalI18nProvider, { i18n, children: /* @__PURE__ */ jsx2(TranslationContext.Provider, { value, children }) });
1868
1869
  };
1869
1870
  var useUnderverseTranslations = (namespace) => {
1870
1871
  const context = React2.useContext(TranslationContext);
1871
- if (!context) {
1872
- return (key) => {
1873
- return getUnderverseDefaultTranslation("en", namespace, key);
1874
- };
1875
- }
1876
- return context.t(namespace);
1872
+ return React2.useMemo(() => {
1873
+ if (!context) {
1874
+ return (key) => {
1875
+ return getUnderverseDefaultTranslation("en", namespace, key);
1876
+ };
1877
+ }
1878
+ return context.t(namespace);
1879
+ }, [context, namespace]);
1877
1880
  };
1878
1881
  var useUnderverseLocale = () => {
1879
1882
  const context = React2.useContext(TranslationContext);
@@ -2023,10 +2026,10 @@ function useSmartTranslations(namespace) {
2023
2026
  setEnvironmentLocale(detected);
2024
2027
  }
2025
2028
  }, [forceInternal, internalLocale, nextIntlBridge]);
2026
- if (forceInternal) {
2027
- return internalT;
2028
- }
2029
- return (key) => {
2029
+ return React4.useCallback((key) => {
2030
+ if (forceInternal) {
2031
+ return internalT(key);
2032
+ }
2030
2033
  const resolvedEnvironmentLocale = environmentLocale && environmentLocale !== internalLocale ? environmentLocale : null;
2031
2034
  const primaryLocale = nextIntlBridge?.locale ?? resolvedEnvironmentLocale ?? internalLocale;
2032
2035
  const fallbackLocale = resolvedEnvironmentLocale && resolvedEnvironmentLocale !== primaryLocale ? resolvedEnvironmentLocale : null;
@@ -2055,7 +2058,7 @@ function useSmartTranslations(namespace) {
2055
2058
  return internalValue;
2056
2059
  }
2057
2060
  return key;
2058
- };
2061
+ }, [environmentLocale, forceInternal, internalLocale, internalT, namespace, nextIntlBridge]);
2059
2062
  }
2060
2063
  function useSmartLocale() {
2061
2064
  const forceInternal = React4.useContext(ForceInternalContext);
@@ -2461,4 +2464,4 @@ export {
2461
2464
  mergeRefs,
2462
2465
  Tooltip
2463
2466
  };
2464
- //# sourceMappingURL=chunk-GSBRTFP2.js.map
2467
+ //# sourceMappingURL=chunk-XJR7E6QB.js.map