Bug Fixes
- Fixes a bug where there could be a cache mismatch when re-rendering the same component that has a fetch policy configured.
Bug Fixes
- Fixes a bug where the
lazy
prop was not always respected. Anytime that a new request key was generated, a request would be made.
Bug Fixes
- Fixes a bug where an Uncaught ReferenceError could be thrown
Bug Fixes
- This fixes a problem where the default
fetchPolicy
would be"cache-first"
for "write" requests.
Breaking
transformResponse
has been renamed to betransformData
fetchPolicy
is now determined by the method that you pass in. This change was made to support using POST methods for read requests, and is unlikely to break your code.- A new prop,
cacheResponse
, is used to determine if a response is added to the cache or not. This is to support using POST methods for read requests, and is unlikely to break your code.
New Features
- A new
failed
property is passed to you in the render prop callback. This allows you to quickly determine if a request failed for any reason (be it network errors or "error" status codes).
New Features
responseType
can now be specified as a function. It receives theresponse
as the first argument.- Adds a
requestKey
prop. - When the request is "faux-aborted," the error will have a
name
equal toAbortError
. This matches the name of the native error, allowing you to write future-proof code that handles aborted requests.
Breaking
- The
responseType
will now be set to"text"
anytime a response returns with a 204 status code. - The
responseType
is no longer used when creating the request key.
Changes
fetch-dedupe
has been abstracted into a separate library. This does not change the public API of this library.
New Features
- The render prop will now be passed the
requestKey
.
React's new Context API has been finalized, and it uses functional children
rather than a prop
named render
. Accordingly, this library has been updated to use children
as the default.
Breaking
<Fetch/>
now useschildren
as the render prop, rather thanrender
.