Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tree, selection throwing an mutation exception on action @@react-redux-grid/SET_SELECTION #230

Open
Birtija opened this issue Jul 3, 2020 · 0 comments

Comments

@Birtija
Copy link

Birtija commented Jul 3, 2020

I used grid type Tree like this:

 const complexData = {
    showTreeRootNode: false,
    dataSource: (extraParams) =>
      getChildEntities(props.requestType, extraParams),
    gridType: "tree",
    dragAndDrop: false,
    columns: columns,
    store: store,
    stateKey: "tree-grid-oj",
    plugins: {
      GRID_ACTIONS: null,
      SELECTION_MODEL: {
        mode: "single",
      },
    },
    events: props.events,
  };
 
  return <Grid {...complexData} />;

my combined reducer:

const rootReducer = combineReducers({
 //other reducers for business logic

  //reducers for the react-redux-grid library
  grid: gridReducers.grid,
  dataSource: gridReducers.dataSource,
  errorHandler: gridReducers.errorHandler,
  loader: gridReducers.loader,
  selection: gridReducers.selection,
});

When i use the tree grid without the SELECTION_MODEL part in the plugins evertything works fine,
but when i include it i get the following error:

Uncaught Invariant Violation: A state mutation was detected inside a dispatch, in the path: selection._list._tail.array.0.1._list._tail.array.1.1.1. Take a look at the reducer(s) handling the action {"type":"@@react-redux-grid/SET_SELECTION","id":"tree-item-2","clearSelections":true,"allowDeselect":true,"index":1,"stateKey":"tree-grid-oj"}

I looked at the demo examples but could not find anything that could affect this issue.

Is this a bug or did i do something wrong?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant