I am trying to create a react native android module that handles changing the app langauge on the native level.
I created a TurboModule and I have a function that changes the language as such:
override fun setLocale(locale: String) {
AppCompatDelegate.setApplicationLocales(LocaleListCompat.forLanguageTags(locale))
}
AppCompatDelegate.setApplicationLocales
restarts the app, suboptimal but ok.
My issue is that after the app is restarted a new bundle seems to load because in the console I see mutiple:
BUNDLE ./index.js
and
(NOBRIDGE) LOG Running "SampleApp" with {"rootTag":11,"initialProps":{},"fabric":true}
Here is how the console looks on a fresh app start:
and here is how the console looks like after changing the language:
They increase as many times as you change the language. How do I prevent the multiple bundle load?