Skip to content

v3.0.0

Latest
Compare
Choose a tag to compare
@idanlo idanlo released this 14 Apr 16:51

Version 3.0.0 Breaking Change

Before version 3.0.0 the parameters to props.children were passed in this order - data, loading, error. It is now passed as an object, so you would now use the Album component like this -

<Album id={...}>
  {({ data }) => {
    return <></>;
  }}
</Album>

As opposed to the previous versions where you would use the components like this -

<Album id={...}>
  {(data, loading, error) => {
    return <></>;
  }}
</Album>

This way you can choose which parameters you would like to have, and if you want just the error parameter you can omit the other two. This works well with the loadMoreData parameter, you don't need to write all 4 parameters if you just need some of them.

  • update README.md 94aeb11
  • calling props.children directly, add loadMoreData function to useApiRequest which can load more data if the data object has the 'next' and 'items' properties, the parameters are now an object and not multiple params 8fb3e9f

v2.6.0...v3.0.0