Replies: 1 comment 2 replies
-
If one uses https://github.com/pmndrs/eslint-plugin-valtio, it disallows using |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I found unexpected (and, as far as I could find, undocumented) differences in the behavior of
this
within a valtio proxy depending on whether a class function is written with fat arrow => syntax or without. I'm new to js, so this behavior might be obvious to those with more experience with the language.Repro: I have a
class BoardModel
which I access through a proxy like so:I was using the => syntax to ensure
this
was correctly bound if I passed the function as a callback - less relevant for this function, more so for one likehandleSquareChanged
. Are there best practices for creating classes for state models that avoids these gotchas?Beta Was this translation helpful? Give feedback.
All reactions