guys!
Did anybody got
"Warning: Accessing PropTypes via the main React package is deprecated. Use the prop-types package from npm instead."
while using React 15.5.3 "react-transition-group/CSSTransitionGroup"
add-on.
It looks like this addon uses old PropTypes. Do somebody know how to avoid this Warning for this add-on?
It has been deprecated After React version 15.5. Hence you need to install it separately.,
Install: npm install prop-types
import React from 'react';
import PropTypes from 'prop-types';
class Component extends React.Component {
render() {
return <div>{this.props.text}</div>;
}
}
Component.propTypes = {
text: PropTypes.string.isRequired,
};
Edit: You need to get updated package for add-on compatible with react latest updates. It the package is yet not updated, you can make changes to them ypurself.
This bug fixed automatically when I updated "react-transition-group" to latest version. It looks that the npm package now works on PropTypes from 'prop-types'.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With