how to spread an array and add new values to it inside useeffect code example Example: usestate array push setTheArray([...theArray, newElement]);