marcin-piela / react-fetching-library

Simple and powerful API client for react 👍 Use hooks or FACCs to fetch data in easy way. No dependencies! Just react under the hood.
MIT License
624 stars 34 forks source link

Correct way to conditionally use hooks #149

Open jonflynng opened 3 years ago

jonflynng commented 3 years ago

Hi, we were wondering the best way to conditionally use the hooks from this library to avoid react errors like 'rendered less/more hooks than last time'. Passing in null gives the following type error, but works well:

Screenshot 2021-10-15 at 09 43 36