0

As React Data Grid had issues with server side rendering, it was giving an error "self is not defined" when I was doing the bundling of files. Inorder to fix that I used the following piece of code in my module which fixed it.

var ExecutionEnvironment = require('exenv'); if (ExecutionEnvironment.canUseDOM) { var ReactDataGrid = require('react-data-grid'); var {Toolbar, Filters: {NumericFilter, AutoCompleteFilter, MultiSelectFilter, SingleSelectFilter}, Data: {Selectors}} = require('react-data-grid-addons'); }

The following above piece of code however fixed the "self is not defined issue". However, it is causing the filter feature not to work. I am facing the following warning alone in console "getDefaultProps is only used on classic React.createClass definitions. Use a static property named defaultProps instead." for filter not working. The filter row appears to be blurred as shown in the image enter image description here

Rakesh Nallam
  • 235
  • 2
  • 6
  • 17

1 Answers1

0

defaultProps replaced the getDefaultProps method in React, to declare defaultProps use

className.defaultProps = {
    propName: propValue,
    anotherName: anotherValue
}
Joshua Underwood
  • 919
  • 4
  • 14
  • Hi Joshua, The warning come as a result the package react-data-grid use the older of way defined i.e. getDefaultProps . Could someone help in fixing this gilter being blurred issue. I am not sure why this is caused. – Rakesh Nallam Nov 21 '17 at 21:58