To copy the value of a variable declared using useState, if it’s an array use:
let varName = [...stateVar];
If it’s not an array use:
let varName = stateVar.valueOf();
To copy the value of a variable declared using useState, if it’s an array use:
let varName = [...stateVar];
If it’s not an array use:
let varName = stateVar.valueOf();

Mark Wong is a front end developer with 10+ years experience. Most of his knowledge of HTML5, CSS and Js is self taught.
| M | T | W | T | F | S | S |
|---|---|---|---|---|---|---|
| 1 | ||||||
| 2 | 3 | 4 | 5 | 6 | 7 | 8 |
| 9 | 10 | 11 | 12 | 13 | 14 | 15 |
| 16 | 17 | 18 | 19 | 20 | 21 | 22 |
| 23 | 24 | 25 | 26 | 27 | 28 | |
Leave a Reply