There are a few hooks you can use in your functional components.
Assure that the logic is mounted when the component renders and is unmounted when the component is destroyed.
This hook is not needed if you use any of the other hooks.
Assure the logic is mounted and fetch actions from the logic. Actions are automatically connected
Assure the logic is mounted and fetch values from it.
You can only use
useValues with destructoring
This is because internally
useValues uses getter functions
that call react-redux's
hooks when a value is accessed. Because hooks need to always be called in the same order,
you can't just store the object returned from
useValues and then use its properties later in
the code. Doing so might call the internal hooks in an unspecified order. Use
useAllValues if you
need to do this.
useValues, but selects all the values in the logic and stores their current state in an object.