Answers for "state update in react js"

1

changing state value react

const [a, b] = React.useState(['hi','world']);
  const dup = [...a]; //won't work without spread operator
  b(dup);
Posted by: Guest on August-23-2021
0

updatig state in react

return {
  ...state,
  (updates here)
}
Posted by: Guest on July-06-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language