My app displays some Texts. I need to re-render a Component
when the font size changes via Settings --> Accessibility --> Font size:
So basically this is se sequence:
- The app is opened (foreground).
- The user opens the Phone Settings so the app goes to foreground (not completely closed).
- The user changes the Font size via via Settings --> Accessibility --> Font size.
- The user closes the Settings and opens the app goes to foreground again.
At this point I need to reload the app because some Components
need to be adapted.
I'm using react-native-device-info to get the font size using const fontScale = DeviceInfo.getFontScale();
but its value doesn't get updated until the app is completely closed and opened.
Any ideas?
You can set the
appstate
tonextAppState
. It should cause the component to rerender.