I18nManager constants are not updated
See original GitHub issueDescription
facing some issues with using the I18nManager, I read its source here: https://github.com/facebook/react-native/blob/main/Libraries/ReactNative/I18nManager.js
from what I understand getI18nManagerConstants()
is only called once and all of It’s values stay the same, no matter if they change on the native side.
I believe this is not the intended behaviour and should be fixed
Version
v0.69.0-rc.3
Output of npx react-native info
System: OS: Windows 10 10.0.19044 CPU: (12) x64 Intel® Core™ i7-8750H CPU @ 2.20GHz Memory: 12.40 GB / 31.85 GB Binaries: Node: 16.14.2 - C:\Program Files\nodejs\node.EXE Yarn: 1.22.18 - C:\Program Files\nodejs\yarn.CMD npm: 8.5.0 - C:\Program Files\nodejs\npm.CMD Watchman: Not Found SDKs: Android SDK: Not Found Windows SDK: Not Found IDEs: Android Studio: Not Found Visual Studio: 17.2.32516.85 (Visual Studio Community 2022) Languages: Java: 11.0.13 - c:\program files\eclipse adoptium\jdk-11.0.13.8-hotspot\bin\javac.EXE npmPackages: @react-native-community/cli: Not Found react: 18.0.0 => 18.0.0 react-native: 0.69.0-rc.3 => 0.69.0-rc.3 react-native-windows: Not Found npmGlobalPackages: react-native: Not Found
Steps to reproduce
try changing any of the constants from js side and check them again using getConstants
or according props.
Snack, code example, screenshot, or link to a repository
Issue Analytics
- State:
- Created a year ago
- Comments:6 (2 by maintainers)
Top GitHub Comments
Constants are supposed to be constant 😃 Some native module implementation may actually cache the values of constants and not re-execute the native
getConstants
method. If these values are actually dynamic, we should introduce new API’s to access them, and deprecate the values accessed viagetConstants
.You’re right, at least on Android. In case of a configuration change (say the device change locale) those values are not re-accessed.
That being said, this is not a regression and is something that shouldn’t be considered a release blocker. I also believe the same behavior was happening on 0.68 and previous versions.