React state hook that tracks an array and provides methods to modify it.
To cause component re-render you have to use these methods instead of direct interaction with array - it won't cause re-render.
We can ensure that actions object and actions itself will not mutate or change between renders, so there is no need to add it to useEffect dependencies and safe to pass them down to children.
Note: remove
action is deprecated and actually is a copy of removeAt
action. Within closest updates it will gain different functionality.
Run the following command:
[ 1, 2, 3, 4, 5 ]