You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to mutate the data directly with data returned from a POST request rather than simply forcing a revalidation since I already have the new data from the POST request:
But the setData bounded mutate from my hook doesn't appear to be updating/refreshing data on my page when i import this hook directly in to child components and call the bounded mutate when mutating the data correctly.
However it works if I import the hook to the parent and pass setData down as props to all the children. But this is not ideal as some of the children that use this are quite deep.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
I have written a reusable hook as follows:
I am trying to mutate the data directly with data returned from a POST request rather than simply forcing a revalidation since I already have the new data from the POST request:
But the
setData
bounded mutate from my hook doesn't appear to be updating/refreshing data on my page when i import this hook directly in to child components and call the bounded mutate when mutating the data correctly.However it works if I import the hook to the parent and pass
setData
down as props to all the children. But this is not ideal as some of the children that use this are quite deep.Beta Was this translation helpful? Give feedback.
All reactions