# General Translation Changelog: gt-react-native 10.20.0: 从原生存储同步读取区域设置
URL: https://generaltranslation.com/zh/blog/gt-react-native_v10_20_0.mdx
Docs index: https://generaltranslation.com/llms.txt
Description: 
Authors: Ernest McCarter
Published: 2026-06-01

## 概览

**gt-react-native 10.20.0** 新增了 `getLocaleFromNativeStore()` —— 一个同步函数，可直接从原生存储中读取已持久化的区域设置，无需依赖 React context。

## 用法

```tsx copy
import { getLocaleFromNativeStore } from 'gt-react-native';

// 读取已持久化的区域设置
const locale = getLocaleFromNativeStore();
// => 'en-US' | null
```

如果你的 [`GTProvider`](/docs/react/reference/components/gt-provider) 使用了自定义的 `localeCookieName`，请传入同一个键：

```tsx copy
const locale = getLocaleFromNativeStore('my-custom-key');
```

## ⚠️ Sync 注意事项

原生存储中的值可能会**与 React 状态不同步**。在区域设置切换期间，存储中可能仍然保留旧值 (反之亦然) 。适用于需要快速命令式读取且可以接受数据暂时过期的场景；如果需要响应式更新，请改用 [`useLocale()`](/docs/react/reference/hooks/use-locale)。

***

[PR #1537](https://github.com/generaltranslation/gt/pull/1537)

## Sitemap

See the full [sitemap](https://generaltranslation.com/sitemap.md) for all pages.
