Skip to content

Replacing Array does not update component. #762

Closed Answered by lkdm
lkdm asked this question in Q&A
Discussion options

You must be logged in to vote

Solved!

The solution is to only select ONE attribute at a time (not value and error). In fact, selecting value isn't even necessary for most/all inputs.

const error = useStore(useCallback(state => state.fields[props.id].error, [props.id]), shallow)

I would still appreciate any input if anyone has suggestions on how to improve the code.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by lkdm
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant