我已经有了一些接口,我想用这个接口来描述模型,就像下面的代码一样.否则,我必须通过再次使用写types的mobx-state-tree.但这不是正确的方法,什么是有效的解决方案?
import { types } from 'mobx-state-tree';
export interface IPeople {
name: string;
age: number;
}
const Peoples = types
.model({
name: 'peoples',
nancy: IPeople, // error at this line
})
export default Peoples;
Run Code Online (Sandbox Code Playgroud)