-
Notifications
You must be signed in to change notification settings - Fork 90
Closed
Description
When I saw the existence of isLoading, I assumed it would be true from the moment the react-async component mounted until the query promise I provided was completed. Instead, though, isLoading is momentarily false for the first render or so, until the state has had a chance to update, because the component doesn't know that a promiseFn was necessarily provided.
Two options I see:
- on construction, set isLoading to true if there is a promiseFn provided and it produces a promise
- naming clarity: provide a new param,
isReadythat is set to!!finishedAt - provision of some kind of warning in the documentation about
isLoadingnot being true initially.
The first option is probably the most intuitive for the user.
Metadata
Metadata
Assignees
Labels
No labels