I'm using redux-orm with JS and all is working ok, but I having problems translating my code from JS to TypeScript.
I already implemented the method render() in my Folder Model Class, but the TS transpiler says:
Property 'name' does not exist on type 'Folder'
How can I indicate TypeScript that the name property exists in Folder instances?
interface IFolder{
id: number;
name: string;
parent: any;
}
export class Folder extends Model<ModelFields, IFolder>{
static get modelName() {
return 'Folder';
}
get render(){
return (<p>{this.name}</p>)
}
static get fields() {
return {
id: attr(),
name: attr(),
parent: fk('Folder', 'children')
};
}
}