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
constChild=types.model({}).actions(self=>({fetchName: flow(function*fetchName(){// As soon as url is used in a yield,// it will throws an error: "... because it does not have a type annotation and is referenced directly or indirectly in its own initializer"consturl=getParentOfType(self,Parent);yieldfetch(url);})}));
Describe the expected behavior
When I get the data from getParentOfType, and use it inside a yield of a flow, I would like to not getting a typescript error.
Describe the observed behavior
The Parent and Child both get an error:
implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer.
This only happens when I use data from getParentOfType inside the yield of a flow, and strict mode is enabled in tsconfig. The functionality behaves correctly though.
Related issue: #1305 (closed but not solved)
Same issue referenced in a comment: #1157 (comment)
The text was updated successfully, but these errors were encountered:
@ErnoW Based on your example its hard to know what your expected behavior should be. The current code example doesn't really show the error nor does the referenced code annotate any TS types. Can you update the example to show the described error?
Bug report
Sandbox link or minimal reproduction code
Link to reproduction: https://codesandbox.io/s/zealous-field-hq5ck
tsconfig needs to have:
Describe the expected behavior
When I get the data from
getParentOfType
, and use it inside a yield of a flow, I would like to not getting a typescript error.Describe the observed behavior
The Parent and Child both get an error:
This only happens when I use data from
getParentOfType
inside theyield
of aflow
, and strict mode is enabled intsconfig
. The functionality behaves correctly though.Related issue: #1305 (closed but not solved)
Same issue referenced in a comment: #1157 (comment)
The text was updated successfully, but these errors were encountered: