WARNINGS: React.createClass is deprecated, accessing PropTypes via the React main package is deprecated
Closed this issue ยท 14 comments
I installed react-bootstrap-date-picker, and used it in a component, and I got some deprecated errors.
Expected Behavior
react-bootstrap-date-picker should work without warnings of deprecated parts.
Current Behavior
Getting these following error messages when using component:
warning.js:36 Warning: Accessing PropTypes via the main React package is deprecated. Use the prop-types package from npm instead.
warning.js:36 Warning: DatePickerHeader: React.createClass is deprecated and will be removed in version 16. Use plain JavaScript classes instead. If you're not yet ready to migrate, create-react-class is available on npm as a drop-in replacement.
Possible Solution
The error messages give some steps to how to avoid getting them. Like using create-react-class and prop-types packages from npm.
Steps to Reproduce (for bugs)
- Install react-bootstrap-date-picker (npm install --save react-bootstrap-date-picker).
- Import DatePicker form 'react-bootstrap-date-picker'.
- Use component somewhere in your code.
- See warning message in developer tools console.
Context
Your Environment
- Version used: 5.0.1
- Browser Name and version: Chrome: Version 58.0.3029.110 (64-bit)
- Operating System and version (desktop or mobile): Ubuntu xenial 16.04.2 (virtual machine) on Windows 10 host machine
Same issue here.
It seems that the last version available on NPM, 5.0.1, doesn't have the latest changes that I can see on GitHub and still uses React.createClass.
when will this be available in npm?? is there anyway i can get the latest change?
src/index.jsx#L83 is using PropTypes from React.
Pushed 5.1.0 representing the current master. https://www.npmjs.com/package/react-bootstrap-date-picker
Thank you, but as mentioned by mervynrwtw, index.jsx is correctly importing PropTypes from 'prop-types', but still using React.PropTypes instead, which still triggers the second warning. See here : https://github.com/pushtell/react-bootstrap-date-picker/blob/master/src/index.jsx#L82
@nathanvogel please consider resolving this issue and creating a pull request.
I considered doing so, but I'll need a bit of time since this would be my first time doing a pull request :) I'll try today or tomorrow.
It looks like #133 addresses the remaining issue with index.jsx, is there any way we can get that merged and released?
This issue, and #134 are now fixed in master - just need a new minor version pushed to npm. (package.json is ready at version 5.1.1 - current npm version is 5.1.0).
I'm not sure how releasing to npm is being handled at the moment - doesn't seem to be through CI.
Use DaemonAlchemist/react-bootstrap-date-picker instead. it supports React16 natively.
Why is this issue closed?