Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

changing state value react

  const [a, b] = React.useState(['hi','world']);
  const dup = [...a]; //won't work without spread operator
  b(dup);
Source by reactjs.org #
 
PREVIOUS NEXT
Tagged: #changing #state #react
ADD COMMENT
Topic
Name
9+8 =