Answers for "how to setState in hooks to overwright object"

2

prevstate in usestate

const [prevState, setState] = React.useState([]);

setState(prevState => [...prevState, 'somedata'] );
Posted by: Guest on June-09-2020

Code answers related to "how to setState in hooks to overwright object"

Code answers related to "Javascript"

Browse Popular Code Answers by Language