- Root store
```js
import { types, Instance } from "mobx-state-tree"
import { Settings, SettingsModel, Setting, SettingModel } from "./Settings"
import { User, UserModel, Users, UsersModel } from "./User"
export const RootStore = types.model("RootStore", {
users: Users,
})
export type RootStoreModel = Instance<typeof RootStore>
export type RootStoreEnv = {
users: UsersModel
}
error:
Invalid type definition for property 'users', it looks like you passed a function. Did you forget to invoke it, or did you intend to declare a view / action?
Sorry for spam, but i have some one question.
I was try to connect models defined with you decorators with root store, but get an error.
@model class BaseUser { @id userId @str login }
@model class UserModel extends BaseUser{ @maybe(str) firstName @maybe(str) secondName @maybe(str) phone @maybe(str) email }
const User = maybe(ref(UserModel))
@model class UsersModel { @map(User) users }
const Users = maybe(ref(UsersModel))
export { User, UserModel, Users, UsersModel }
Can you help? or extend documentation? Thanks