how to push array in usestate code example
Example 1: React Hooks append state
setTheArray(currentArray => [...currentArray, newElement])
Example 2: usestate array push
setTheArray([...theArray, newElement]);
Example 3: add object to array react hook
setTheArray([...theArray, newElement]);