makeAutoObservable defining class prototype functions with arguments as actions? #3044
Unanswered
solugebefola
asked this question in
Q&A
Replies: 2 comments 4 replies
-
Keyword |
Beta Was this translation helpful? Give feedback.
4 replies
-
Verify that field initializers are configured correctly in TypeScript /
Babel, as shown in the docs. Otherwise a field initializer counts as an
assignment made in the constructor, so the code calling the constructor
should be an action as well, when "strict" setting is used.
…On Sat, 31 Jul 2021, 10:01 Egor Gorbachev, ***@***.***> wrote:
@solugebefola <https://github.com/solugebefola> Did you manage to
reproduce the issue in codesandbox?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#3044 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAN4NBHTLFI5RZ47VVUAQJDT2OUXNANCNFSM5BE4GZEA>
.
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
When linting in "strict" mode, I'm continually getting this warning:
for functions defined on classes. Ex: (edited)
According to the docs,
makeAutoObservable
should makechangeObservableValue
into an action, but that appears not to be the case? The only thing I can think of is that a function that takes an argument is not defined as an action, since none of the examples in the docs show a function in the prototype that takes arguments, but I couldn't find anywhere that it was explicitly noted.Sorry if this is completely obvious, but I'm a bit stymied.
Beta Was this translation helpful? Give feedback.
All reactions