v2.0.1
In this patch release, we majorly improved typing support and SWR can infer the types based on the configuration.
- When the
suspense
option istrue
, the returneddata
will excludeundefined
and theisLoading
will always befalse
. - When the
fallbackData
option is provided, the returneddata
will be the same type offallbackData
, and theisLoading
will always befalse
.
Here's a demo for it:
swr-2.0.1.mp4
What's Changed
- types: make FullConfiguration generic by @huozhi in #2273
- type: enforce array literal as tuple by @promer94 in #2283
- Improve type test by @promer94 in #2289
- update bunchee to remove the extra target cli option by @huozhi in #2298
- fix: useSWRMutation should always use the latest fetcher by @koba04 in #2290
- types: conditional swr response by @huozhi in #2301
- fix: types properites in exports fields by @koba04 in #2341
- Update license year by @IcedMonk in #2344
- feat: add all mutate options support to useSWRInfinite by @koba04 in #2350
- ci: add publint to check packaging on CI by @koba04 in #2363
New Contributors
Full Changelog: 2.0.0...v2.0.1