Type issue when assigning a store with a reference #1764
Labels
help/PR welcome
Help/Pull request from contributors to fix the issue is welcome
Typescript
Issue related to Typescript typings
Bug report
Sandbox link or minimal reproduction code
https://codesandbox.io/s/mobx-state-tree-todolist-forked-o9yj3
Describe the expected behavior
In the example we're defining a root store with another store as a property. That store has a property of type array of a model.
When that model doesn't have a types.reference present everything is fine. However, when the model does have a types.reference present typescript complains about an incorrect type.
Typescript should resolve these types correctly.
Describe the observed behavior
As seen in the
rootStore
, where there is a version with and without the reference, the one with the reference generates a typescript error about thesomeModel
type not matching.The text was updated successfully, but these errors were encountered: