bencripps / react-redux-grid

A React Grid/Tree Component written in the Redux Pattern
http://react-redux-grid.herokuapp.com/
MIT License
446 stars 63 forks source link

PropTypes (oneOf) error when loading the Grid #216

Open varga-boglarka opened 5 years ago

varga-boglarka commented 5 years ago

Hi,

I found a very similar issue to #166. I continuosly get the following error message in the browser console, as the grid has been loaded:

index.js:2178 Warning: Failed prop type: Invalid prop data of value [object Object] supplied to Grid, expected one of [null,null].

The solution might be using oneOfType instead of oneOf when defining the type of 'data' property.

The code is placed in components/Grid.jsx: data: oneOf([ arrayOf(object), object, ]),

oneOf involves the EnumTypeChecker, while oneOfType involves UnionTypeChecker. Currently the EnumTypeChecker's validate method always fails and returns the mentioned error.