[Bridgeless] Multiple bundles loaded on android when locale changed natively #44730
Labels
📦Bundler
Issue: Author Provided Repro
This issue can be reproduced in Snack or an attached project.
Platform: Android
Android applications.
Type: New Architecture
Issues and PRs related to new architecture (Fabric/Turbo Modules)
Description
I am developing an android module that changes the app locale using
AppCompatDelegate
apisetApplicationLocales
as in the android guide which reloads the app as a side effect, but every time the locale is changed and I refresh the app an extra line of:Running "SampleApp" with {"rootTag":101,"initialProps":{},"fabric":true}
is logged to the console. I am not sure if this means there are multiple bundles loaded and there is a memory leak?
I added a
console.log
toApp.tsx
and that console.log is only logged once not as many times as there are theRunning ....
lines so I am not sure about themultiple bundles loaded
termCheck videos below to better understand
Happens only on bridgeless
Steps to reproduce
yarn install
npx react-native@latest run-android
set locale
buttonRunning "SampleApp" with {"rootTag":101,"initialProps":{},"fabric":true}
You will see the
Running....
as many times as you pressed on theset locale
.Note that the
set locale
button simply changes the app language as recommended by android and also that it works when bridgeless is disabledReact Native Version
0.74.1
Affected Platforms
Runtime - Android
Output of
npx react-native info
Reproducer
https://github.com/itsramiel/RN_Bridgeless_Repro
Screenshots and Videos
New Arch: true
Bridgeless: true
reproducable: true
Screen.Recording.2024-05-30.at.7.41.17.PM.mov
New Arch: true
Bridgeless: false
reproducable: false
Screen.Recording.2024-05-30.at.7.43.01.PM.mov
The text was updated successfully, but these errors were encountered: