Replies: 1 comment 1 reply
-
I have a blogpost on this: |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I have some data(a list of objects) I am fetching via useQuery and I want the user to be able to modify this list and submit it as a form, so i am saving it via useState. From my understanding, props in react don't sync with state unless i do something like using useEffect like below. Reason I am doing this is because data is initially undefined, so i need to seed the state with the updated data once it actually comes back.
I was referencing this article from tk: https://tkdodo.eu/blog/putting-props-to-use-state and pretty much the useEffect is seen as a bad idea and anti-pattern. Im wondering if there is an alternative solution ?
Thank you!
Beta Was this translation helpful? Give feedback.
All reactions