souporserious / use-item-list

A primitive React hook used to coordinate indexed collections effortlessly.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

A little suggestion about API, it's related to the latest react hot reloading

joe-sky opened this issue · comments

Hello, I think this project looks very cool~

I see that this library has an API to take custom hooks from the component props. In this way, with the react fast refresh hot reloading, the state of the sub component may be lost 😥.

This is because react fast refresh is implemented based on Babel. When parsing the custom hooks used by sub components, it will treat all the hooks as global functions by default, and ignore the local ones passed in from props. This is a problem that I have encountered in the development, I'd like to share it with you~