I have some interfaces already, and I want to describe models with this interfaces, just like the code below. Otherwise I have to write again by using types
of mobx-state-tree
. But this is not the right way, what is the valid solution ?
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;