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

Deprecation warnings on default props #1403

Closed
3 of 11 tasks
ElmarFrerichs opened this issue Nov 28, 2018 · 16 comments
Closed
3 of 11 tasks

Deprecation warnings on default props #1403

ElmarFrerichs opened this issue Nov 28, 2018 · 16 comments

Comments

@ElmarFrerichs
Copy link

Which version of React JS are you using?

✅ Officially supported ✅

  • v15.4.x

⚠️ Not officially supported, expect warnings ⚠️

  • v15.5.x
  • v15.6.x

☣️ Not officially supported, expect warnings and errors ☣️

  • v16.x.x

Which browser are you using?

✅ Officially supported ✅

  • IE 9 / IE 10 / IE 11
  • Edge
  • Chrome

⚠️ Not officially supported, but "should work" ⚠️

  • Firefox
  • Safari

I'm submitting a ...

  • 🐛 Bug Report
  • 💡 Feature Request

Issue Details

Since at least version 5.0.3 of react-data-grid, I get deprecation warnings for every use of the ReactDataGrid for using the deprecated enableRowSelect and rowScrollTimeout props, without me ever using them. I think it was caused by #1254.

Call in my code:

<ReactDataGrid
  onGridSort={this.handleGridSort}
  columns={this.state.columns}
  rowGetter={this.rowGetter}
  rowsCount={this.getSize()}
  minHeight={currContainerHeight-4}
  onColumnResize={this.onColumnResize}
  headerRowHeight={headerRowHeight} />

Two warnings show up in my console:

> enableRowSelect has been deprecated and will be removed in a future version. Please use rowSelection instead
> undefined

Other deprecated props like onRowUpdated don't show a warning, so I suspect it's got something to do with the defaultProps of enableRowSelect and rowScrollTimeout. The package react-is-deprecated has a closed issue on this, the defaultProps are passed through the propTypes as well so the deprecationWarning will trigger.

The warning message for rowScrollTimeout only has undefined as text because it's propType definition is missing the deprecationWarning() call, but that's another story.

rowScrollTimeout: deprecate(PropTypes.number),

I didn't digg deep enough into react-data-grid yet to see if just removing the 2 defaultProps will cause any side effects, in my case it worked.

Thanks!

PS: Is React 15.4 still the only officially supported version?

@shreyamdg
Copy link

Same messages here!

@ssurve
Copy link

ssurve commented Dec 4, 2018

+1

1 similar comment
@espenmeidell
Copy link

+1

@daneast915
Copy link

+1 in @bentley/ui-components
Using react-data-grid 6.0.1. Please fix in 6.0.2.

@kristian2x
Copy link

+1 using 5.03

@piehouserat
Copy link

+1 using latest

@flyingcrp
Copy link

+1 using

"react-data-grid": "^6.0.2-0",
"react-data-grid-addons": "^6.0.2-0",

@stale
Copy link

stale bot commented Mar 25, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Please reopen this if you feel it has been incorrectly closed and we will do our best to look into it. Thank you for your contributions.

@ihomp
Copy link

ihomp commented Mar 27, 2019

hay stale bot "react-data-grid": "^6.1.0-0", still has this issue. PR is seems like ready to fix it though.

@stale stale bot removed the wontfix label Mar 27, 2019
@piehouserat
Copy link

looks like they're actively working on a new major release which i'm sure will include this PR -> https://github.com/adazzle/react-data-grid/commits/next

doubt they will include this as part of a minor release before then but I could be wrong

@rossjp
Copy link
Contributor

rossjp commented Apr 9, 2019

+1 using 6.1.0

@brianchristensen
Copy link

+1 using

"react-data-grid": "^6.1.0",
"react-data-grid-addons": "^6.1.0",

@ryanakallis
Copy link

ryanakallis commented Jun 5, 2019

Awesome that y'all are sorting out console warnings (^^,)

Workaround:
Set prop 'enableRowSelect' to null :

<ReactDataGrid
  columns={this.state.columns}
  rowGetter={this.rowGetter}
  rowsCount={this.getSize()}

  enableRowSelect={null}

  />

The warning @ElmarFrerichs mentions :
undefined
is still there, no idea what that is.

@m1tttt4
Copy link

m1tttt4 commented Jun 6, 2019

@ryanakallis

Workaround:
Set prop 'enableRowSelect' to null

Same workaround clears the other undefined caused by rowScrollTimeout as @ElmarFrerichs suspected

<ReactDataGrid
  ...
  enableRowSelect={null}
  rowScrollTimeout={null}
/>

Edit to include version info:

"react": "^16.8.6",
"react-data-grid": "^6.1.0",
"react-data-grid-addons": "^6.1.0",

Still a valid workaround for suppressing deprecated prop warnings.

@kaminskypavel
Copy link

yup still happening by default at

    "react": "^16.8.6",
    "react-data-grid": "^6.1.0",
    "react-data-grid-addons": "^6.1.0",

@m1tttt4 solution will break current types definitions with \

Error:(127, 11) TS2322: Type 'null' is not assignable to type 'boolean | "single" | "multi" | undefined'.

@ElmarFrerichs
Copy link
Author

Resolved in version 7.0.0-alpha.18, I'll reopen it if it happens again.

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