Learn how to set state in Recoil using the useRecoilState
hook.
Sound familiar? It should, because it works very similarly to React's built-in useState
hook (the functional component equivalent of setState
).
In this lesson, we'll practice removing and adding items from an array that we keep in state using a Recoil atom. We'll create new immutable functions, and then call our setter functions in order to update the state.