- you can be in an inconsistent state that should not exist, e.g. isLoading and isError at the same time
- state transitions that should not be possible can be performed if you make a mistake
The first one you can easily fix without a library by using a state enum instead of a bunch of booleans. The second one is probably better handled by a library that implements a declared state machine or state chart. In Javascript that would be e.g. xstate (https://xstate.js.org/).
I found that simply thinking about the states and writing them down as a state machine is already very helpful in avoiding certain kinds of issues that arise when you just do this on the fly.