You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We're using monolite to customize parts of our mock state trees for particular test suites, and I'm trying to upgrade from 0.4.6 to 0.8.0. I notice the syntax for set has changed to take the new state as a third argument. No problem, fixed that up. I'm having trouble with the second argument (the accessor function). When the portion of state being modified is an optional parameter of its interface, I get this error:
Argument of type '(_: StateTree) => string | undefined' is not assignable to parameter of type 'Accessor<StateTree, {}>'.
Type '(_: StateTree) => string | undefined' is not assignable to type 'AccessorFunction<StateTree, {}>'.
Type 'string | undefined' is not assignable to type '{}'.
Type 'undefined' is not assignable to type '{}'. [2345]
It seems that the AccessorFunction's second generic type is not being properly inferred when it is optional (string | undefined in this case).
Here's some sample code that reproduces the above error:
We're using monolite to customize parts of our mock state trees for particular test suites, and I'm trying to upgrade from 0.4.6 to 0.8.0. I notice the syntax for
set
has changed to take the new state as a third argument. No problem, fixed that up. I'm having trouble with the second argument (the accessor function). When the portion of state being modified is an optional parameter of its interface, I get this error:It seems that the
AccessorFunction
's second generic type is not being properly inferred when it is optional (string | undefined
in this case).Here's some sample code that reproduces the above error:
This is literally the first issue I've ever opened on GitHub, so let me know what I'm doing wrong, what else you need, etc.
The text was updated successfully, but these errors were encountered: