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
A new major version! We bumped the version number, because some BC-breaks were introduced.
Changes:
A new <SelectLink /> component. This component renders a HTML <select> form field, and populates the <option> list with a list of links from a resource.
A new useNewResource hook. This hook is explicitly designed to let users create new resources with a POST request, and continue editing the newly created resource with PUT requests. This functionality existed in useResource before, but it never worked well.
Dramatically reduced the number of renders, in some cases from 5 to 1. To get the maximum benefit, make sure you're on React 18.
useResource no longer has a mode option. If you used PUT here, you can just remove the option as it's the default. If you used POST, you'll want to migrate to useNewResource.
Fix an infinite rendering bug when passing a promise as the resource argument to useResource
useCollection now returns 'resourceState' and 'resource', which makes it
less likely that someone needs both useResource and useCollection in
the same component. These objects were already readily available, so might
as well return them.
BC Break: The signature of useResource has changed, but only if you were
passing options. If you called useResource(options) before, it must now
be structured as useResource(resource, options) to be consistent with
every other hook. See #63 for more information.
In some cases when a React component passes a new resource as a string to
useResource, the useResource might return "undefined" for the resource,
which can result in a white screen of death.
This one was a bit of a doozy, check the PR for more information: #67
Remove an unneeded initial render in useCollection.
In some cases when a React component passes a new resource as a string to
useResource, the useResource might return "undefined" for the resource,
which can result in a white screen of death.
See PR #67 for details. Backported in #70 for the 2.x.x branch.