Say you use the useState hook to set some state:
const [text, setText] = useState('');
If I set some variable to text and setText like:
let textCopy = text;
let setTextCopy = setText;
If I try and use setTextCopy('Some text')
, would this actually update both text and textCopy?
If this does not work, what would be the best way to approach this?
I know this is probably not a great question I just wasn't sure how to word it. If you have any helpful links I would appreciate it.