Open xnmeet opened 6 days ago
When useAsyncFn is used and the given initial value loading is true, subsequent fetch will not be able to update the loading state
const [state, fetch] = useAsyncFn( async () => { await sleep(); return 'hello'; }, undefined, { loading: true }, ); console.log(state.loading); // once to false and don't change again
yarn test
yarn lint
yarn lint:fix
yarn lint:types
Description
When useAsyncFn is used and the given initial value loading is true, subsequent fetch will not be able to update the loading state
Type of change
Checklist
yarn test
)yarn lint
). Fix it withyarn lint:fix
in case of failure.yarn lint:types
).