Is there a way to get the underlying object from a state proxy? #13301
Answered
by
brunnerh
peterreeves
asked this question in
Q&A
-
Is there some way to get a reference to the underlying object from a state proxy? I was under the impression that const myObj = {
val: 3
};
const stateObj = $state(myObj);
console.log(myObj === $state.snapshot(stateObj)); // Prints `false` |
Beta Was this translation helpful? Give feedback.
Answered by
brunnerh
Sep 18, 2024
Replies: 1 comment 5 replies
-
(This comment has more info on the removal.) |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Wrapping elements in a proxy internally does not seem very useful.
Wrapping does not affect the original object (and changes to the proxy also do not affect the original object).