Skip to content

1.0.45 - The core parameters update

Compare
Choose a tag to compare
@hazae41 hazae41 released this 29 Aug 12:45
· 860 commits to master since this release

NO BREAKING CHANGES

CHANGES

  • You can now use XSWR.ParamsProvider to provide custom params to all children without changing the core provider
export default function Wrapper() {
  return <XSWR.ParamsProvider
    serializer={GZIP}>
    <Page />
  </XSWR.ParamsProvider>
}

Since params = { ...parent, ...current } the downmost params will override.
If I then use a custom serializer in my handle, JSON will be used instead of GZIP.

useSingle(url, fetcher, { serializer: JSON })