What's going on?
When I define mst models, everything works fine at first. But when I insert .extend(withRootStore) into model definition chain, every model type inference is broken. After withRootStore injected, the store model and rootStore model are inferenced as type any.
Does anybody knows this answer?
Steps to reproduce
- Create ignite project
- Choose any model you want
- import withRootStore and inject with extend method
example
import { withEnvironment, withRootStore } from "../extensions"
export const QuestionStoreModel = types
.model("QuestionStore")
.props({
questions: types.optional(types.array(QuestionModel), []),
})
.extend(withEnvironment)
.extend(withRootStore)
- After then, type inference of store models are broken. Infered as Any type. Also type of RootStore is infered as any too.