how to push value in state array react with usestate code example Example: usestate array push setTheArray([...theArray, newElement]);