Open tabfugnic opened 3 years ago
Packages related to React Native are community-driven. PRs are welcome
Hi! I think it is not a bug.
See my demo - https://snack.expo.io/hmEZX7a_b.
I think the styled Container
is rendered everytime when you enter some words and then onChangeText
works with rendering whole App
.
So, App
is rendered, new styled Component
is made.
Each time it is rendered, a new Component
is applied, so it seems that there is a flickering.
As in my demo, declaring the styled component outside the function can solve the flickering. Also, if you declare a styled component in a function, I think it will be solved by using React.useMemo
.
Current behavior:
Using styled components and wrapping a TextInput that provides an onChangeText event creates flickery behavior. Removing the styled component and styling the component, in this case a
View
, directly fixes this problem.To reproduce:
Please refer to https://snack.expo.io/Oz9BptF4Z
Steps to reproduce:
Expected behavior:
It should work the same as a plain ol' View component.
Environment information: