-
i have a react hook form fields list, by which I am rendering list of input element on flashlist, all works fine but when I manually update the value of the list state using react-hook-form setValue function it does update the fields list but the UI is not updated specially input field value Expected behaviorTextInput Value should update To Reproduce
code
|
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 2 replies
-
I've not looked too deep into your use-case, since it would take a while for me to get a React Native sandbox running, but I believe most of the virtual lists including |
Beta Was this translation helpful? Give feedback.
-
not really solve my issue. please check the issue please |
Beta Was this translation helpful? Give feedback.
-
here setValue doesn't rerender the list. is there any way we can do rerender, maybe generate a completely new list with new field.id |
Beta Was this translation helpful? Give feedback.
-
From what I've been able to compile, you need to provide a non-empty container element to <FlashList
data={fields}
renderItem={({ item, index }) => {
return (
- <>
+ <View key={item.id}>
<Text>{item.name}</Text>
<TestInput control={control} name={`list.${index}.age`} />
- </>
+ </View>
)
}}
keyExtractor={(item) => item.id}
/> |
Beta Was this translation helpful? Give feedback.
-
it works thanks a lot |
Beta Was this translation helpful? Give feedback.
From what I've been able to compile, you need to provide a non-empty container element to
renderItem
with thekey
prop set toitem.id