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
With 1.0 the old revalidate was deprecated.
We intentionally re-exported this function from our swr based hooks as refresh to update the data (via FlatList pull to refresh).
What is the recommended way of re-exporting mutate with the same signature as revalidate now? Verbatim exporting mutate risks accidental misuse, when its uses as a event handler where it is passed a NativeEvent which would then mutate the data to be the events data.
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.
Uh oh!
There was an error while loading. Please reload this page.
-
With 1.0 the old
revalidate
was deprecated.We intentionally re-exported this function from our swr based hooks as
refresh
to update the data (via FlatList pull to refresh).What is the recommended way of re-exporting mutate with the same signature as
revalidate
now? Verbatim exportingmutate
risks accidental misuse, when its uses as a event handler where it is passed aNativeEvent
which would then mutate the data to be the events data.The only way I see at the moment is:
But that introduces some boilerplate code now and it still changes the returned signature from
Promise<bool>
toPromise<Data | undefined>
Beta Was this translation helpful? Give feedback.
All reactions