T
TanStack•3y ago
inland-turquoise

How to prevent a no data issue on further query if I unmount a component that is fetching data?

5 Replies
exotic-emerald
exotic-emerald•3y ago
What is the issue in the sandbox?
inland-turquoise
inland-turquoiseOP•3y ago
@julien the state is being loading forever even if the network request has completed
exotic-emerald
exotic-emerald•3y ago
The logic is inverted on this line:
return isLoading ? <div>I have some todos</div> : <div>Loading todos...</div>;
return isLoading ? <div>I have some todos</div> : <div>Loading todos...</div>;
inland-turquoise
inland-turquoiseOP•3y ago
@julien omg. sorry about wasting your time.
exotic-emerald
exotic-emerald•3y ago
No worries 🙂

Did you find this page helpful?