mobx-state-tree invalid type definition for property 'lessons', it looks like you passed on object

493 Views Asked by At

This is the model that is expecting the lessons:

export const LessonModel = types.model({
    is_imported: types.boolean,
})

const CalendarStoreModel = types.model('newCalendarStore',{
    lessons: types.optional(types.array(LessonModel),[]),
     selectedDate: types.string
})

and here I am providing the lessons

const model = {
    lessons: [  
       {
        is_imported: false,
       }
    ],
    selectedDate: "2020-10-21"
}

Tried wrapping the lessons on LessonModel.create but it did not fix it.

0

There are 0 best solutions below