-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Getting getDefaultProps warnings with react 15.6+ #978
Comments
Looks like the following files still have references to getDefaultProps: packages/react-data-grid-addons/src/editors/DateRangeEditor.js But now that I look at the source code you're using createReactClass which means in order to fully convert this to the correct way of defining defaultProps you would have to change how you declare classes as well. Not a tough thing to do, but also not a trivial task. |
Warning: getDefaultProps is only used on classic React.createClass definitions. Use a static property named I'm getting same error please me on this |
I also get the same error. I use the basic example, and in my code : And the Example code: export default class Example extends React.Component {
} createRows = () => {
}; rowGetter = (i) => { render() { i use the 15.4.2 react ,react-dom, and really don't know how to solve it, could anyone help me? Thanks a lot! |
I saw aschonfeld's comment, do that mean react-data-grid need an upgrade to remove these es5 code to es6? Or is there something wrong with the code we use it? |
Either they need to update hiw they declare getDefaultProps or you’ll need to downgrade the version of React you use in order to make these dissapear. |
|
Thanks @aschonfeld @wKovacs64 ! I feel so strange , the example code has been in ES6 format , it seems that i have to give up using this component. |
Any timeframe on when this will be fixed? I'm using version 2.0.66 and this isn't working with React 16. |
Doesn't look like this code is being supported any longer. Last release 10 months ago and breaking with current React. Need to find another solution. |
@jessie20000503 @alienintheheights I'll admit, the way this project is managed is mildly infuriating compared to most OSS, but it is definitely still being worked on. Ignore the releases tab on GitHub - that's based on git tags and apparently they haven't tagged anything since 2.0.2, but 2.0.69 was released just yesterday (2017-10-27). If you want to use React 16 before this project officially supports it (without the warning spam introduced in 2.0.61 due to #970), use version 2.0.60 with the little hack I mentioned in #744. There are a couple follow-up comments below it for |
Good to know it's still active because I haven't found anything better. I'm not on React 16 though. Getting these errors with 15.6.1. |
In that case, you can still use 2.0.60 but skip the hack. You'll get a couple deprecation warnings, but not the slew of warnings shown above. |
Defining The problem seems to occur when development and production versions of
|
It is probably a good idea to revisit |
Interesting. Good catch, @amanmahajan7! |
please check below url https://codesandbox.io/s/3z3lq9zn1 Thanks |
Same problem here, need fix |
I am getting same issue here. It will need to be fixed. Do we know any timeline? |
Same warnings with React Fiber. Although you say React Fiber is "Not officially supported, expect warnings and errors" so it is expected I guess. |
I confirm that setting the package version to Thanks for such an awesome project. This is still the most flexible data grid that I've come across. |
Hi all any update on this :( , im planning to use my product pls help me to fix this |
this 2 files didn't add - ( create-react-class) pls check @amanmahajan7 |
Getting the same error as well and I am using |
@dijonkitchen I just followed what @ wKovacs64 mentioned in his earlier post. I didn't check the version history in this project, but it works. I don't see any glaring issues with 2.0.60 vs. 2.0.73 at the moment. |
Temp workaround:
Just call this function before importing "react-data-grid". |
@amanmahajan7 Could you confirm why #1012 did not work as intended? it appeared to work correctly on one of my projects |
@BenLDouthwaite #1012 broke the example site, it also works as intended on the local environment. I will revisit this PR |
@jpdriver @malonecj I think instead of reverting #954 (move to Another workaround is to import the development version of A better solution would be to specify |
Hi, I look at the code, and it needs to be refactored, also my opinion to get rid of mixins and use other solutions like utility objects, component compositions, high-order components ...etc, these are found by the article written by Dan Abramov, from the official react js website blog Mixins Considered Harmful, written by Dan Abramov, The way to write reactjs class in ES6 does not support mixins, and defaultProps is defined as a property not as a function, but with createReactClass() is defined as a function, Declaring Default Props Thanks |
This is my highest priority issue with react-data-grid, so I would also like to see this fixed soon. When I interact with the table, I get literally thousands of errors in the console, which makes debugging other issues unnecessarily difficult. |
@kaiyoma, I hope, that out communiti will fix it soon, but now you can set filter in Chrome devtool console, like this: |
this issue prevented me from using this library |
+1, we also have been facing the same issue. |
+1 same problem here |
we decided not to use this grid as we are on React16 , and too many issues. bah humbug |
Same here. Too many issues and not enough documentation. |
I switched to react-virtualized and it's been working out really well so far. |
we are now using https://github.com/agracio/ts-react-json-table . it's been doing the job fine for our needs. |
If you're looking for a canvas based solution, and need a high performant data grid which can handle thousands of rows and columns, I highly recommend https://github.com/TonyGermaneri/canvas-datagrid There are very few canvas solutions out there, and I found this one to be great. The documentation is quite good, too. |
After hitting this issue, I searched around and am trying this: https://devexpress.github.io/devextreme-reactive/react/grid/ |
Any information about the fix ? All your projects are good but they don't help me. PS: are you coding a version that works with react 16? (happy new year) |
I used this hack to suppress the error in test files:
Still hoping that this issue will be fixed though as it is blocking us from upgrading to React 16. |
@mmabraham, this issue has been fixed. Please upgrade to v3 |
@mmabraham I believe v3 only fixes the React 15.5+ incompatibility for react-data-grid, not for react-data-grid-addons. react-data-grid v3.0.11 is working fine with React 15.6 but anything I try to pull in from react-data-grid-addons throws the PropTypes and createClass exceptions. @wKovacs64's 3-4 line hack seems to still be required to get the v3.0.11 react-data-grid-addons to work. |
@yoDon We are actively working on |
Updated to : [email protected] I no longer see these errors Can you please update your Github releases? The latest release says 2.X something |
Is there anyway to get this error in eslint/babel-eslint? |
Which version of React JS are you using?
✅ Officially supported ✅
☣️ Not officially supported, expect warnings and errors ☣️
Which browser are you using?
✅ Officially supported ✅
I'm submitting a ...
Issue Details
current behavior:
desired behavior: no warnings
motivation: less noise in console warnings and compatibility to upgrade React
The text was updated successfully, but these errors were encountered: