how to set value react hook usestate code example
Example: prevstate in usestate
const [prevState, setState] = React.useState([]);
setState(prevState => [...prevState, 'somedata'] );
const [prevState, setState] = React.useState([]);
setState(prevState => [...prevState, 'somedata'] );