Replies: 2 comments 1 reply
-
Just an FYI for the future, but this should have been marked as a breaking change. It broke my app, as I was relying on variables from outside the fetcher function. Fortunately it turned out to be an easy fix. |
Beta Was this translation helpful? Give feedback.
-
It was simply because of how I was using variables within the fetcher function. After changing it to not use variables from outside, all is fine. So the fix was simple, and actually better. But your change broke backwards compat due to the latest fetcher being used instead of the initial. |
Beta Was this translation helpful? Give feedback.
-
Highlights of This Release
Use the Latest Fetcher Function
SWR will now use the latest fetcher function passed to the hook, when sending the request. Previously it uses the initial snapshotted fetcher.
Avoid Unnecessary Auto Revalidations
When refocusing on the window with state changes (like clicking a button that changes the SWR key immediately), SWR now avoids revalidations if they're not necessary. Details can be found in #1720.
New Types for
useSWRInfinite
Two types for
useSWRInfinite
are added:SWRInfinteHook
andSWRInfinteKeyLoader
. You can use them to type the hook and thegetKey
function.New
populateCache
option formutate
A new option to control if the mutation data should be written to the cache. You can find the details in #1729.
What's Changed
requestAnimationFrame
more robust by @thomaspaulmann in Make polyfill forrequestAnimationFrame
more robust #1707populateCache
option tomutate
by @shuding in feat: AddpopulateCache
option tomutate
#1729New Contributors
requestAnimationFrame
more robust #1707Full Changelog: 1.1.1...1.1.2
This discussion was created from the release 1.1.2.
Beta Was this translation helpful? Give feedback.
All reactions