Closed thewashingtonhua closed 6 years ago
Where did you get the proptypes warning?
in chrome developer tool.
'prop-types' has been an independent package for quite a while. and I've been using it this way in my recent projects. the team added this warning in several releases ago. you can find that in the release note.
for react 15.x and before. current code still works. but react 16 (which will be launched in days) won't support this syntax any more. guess you might wanna make some updates.
Are you sure the warning is from input-moment
?
I took a deep look at your code. your code seems fine. But they depend on a quite old version of 'react-input-slider' (3.0.0. latest version is 8.3.1) which was using React.PropTypes
. That caused the problem. But from the surface, the warning came when I included your package.
The latest code has been rewritten in the recommended way. How about some yarn upgrade
?
FYI. This also caused issue #60 .
I recommend upgrading input-moment
to the latest version, react-input-slider@3.0.0
doesnt use React.PropTypes
either.
Thank you. with 0.3.6 the problem is no more.
I was using 0.3.5 until last minute. In that version it depends on 'react-input-slider' 1.5.0 (according to your commit record). I saw you adopted 'prop-types' in 2.0.0 with a 'es6 fix' commit. That solved the problem.
BTW, about that 'react-input-slider 8.3.1'. Someone had a package with very similar name to yours (input-slider-react). The search engine gave me that instead of yours. Hence the misunderstanding. Sorry to bother, and thanks again to you work. Very helpful !
Not a big problem (for now). But WILL be when React 16.0 is official (which won't take long).
Just switch to independent 'prop-types' package and everything will be OK.
Official warning goes like this: Accessing PropTypes via the main React package is deprecated, and will be removed in React v16.0. Use the latest available v15.* prop-types package from npm instead. For info on usage, compatibility, migration and more, see https://fb.me/prop-types-docs