Answers for "react write state on value change"

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

Code answers related to "Javascript"

Browse Popular Code Answers by Language