Skip to content

How do I mutate an object inside of an array? #545

@samskiter

Description

@samskiter

Is mutating an item inside of an array, like this todoStore.todos[index].setDone(true) supported?

export class TodoModel extends Model({
  todos: prop<Todo[]>(() => []).withSetter(),
})

I'm finding that this isn't consistently working, especially after first adding a new Todo to the model

Metadata

Metadata

Assignees

No one assigned

    Labels

    ✌ duplicateThis issue or pull request already exists

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions