is useState memorized?

on every render even if state value of particular useState doesn't change , will state variables be re-initialized? is useState internally memorized or not?
2 Replies
NickServ
NickServ16mo ago
Yes it will be memorized
cje
cje16mo ago
It’s not really memoization It’s basically a JavaScript closure But the result is the same, it’s the same variable with the same reference

Did you find this page helpful?