How to force re-render screen when layout is re-render ? #721
Unanswered
JamesHemery
asked this question in
Q&A
Replies: 1 comment
-
Hi @EvanBacon , any idea ? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
In some cases, we want the screen to be re-rendered when the layout is.
For example, using the
twrnc
library to use tailwindcss with react-native, we need to add a hook in the root layout (useDeviceContext
) that watches the dimensions and color scheme of the device.In a React Navigation app, this will re-render the screen and apply the new style properties. But with expo-router, the screen is not re-rendered.
A workaround is modifying the root stack key as soon as the dimensions or color scheme change. But this seems to be a temporary solution.
See jaredh159/tailwind-react-native-classnames#234
Beta Was this translation helpful? Give feedback.
All reactions