const [a, b] = React.useState(['hi','world']); const dup = [...a]; //won't work without spread operator b(dup);