zatziky zatziky - 1 month ago 15
React JSX Question

React-Bootstrap: manually calling a React.PropTypes validation function

After upgrading my project after coming back to it after 2 weeks I receive lots of warning I can't get rid of:


warning.js:44 Warning: You are manually calling a React.PropTypes validation function for the
onClick
prop on
NavbarToggle
. This is deprecated and will not work in the next major version. You may be seeing this warning due to a third-party PropTypes library.

warning.js:44 Warning: You are manually calling a React.PropTypes validation function for the
onClick
prop on
NavItem
. This is deprecated and will not work in the next major version. You may be seeing this warning due to a third-party PropTypes library.


Obviously, they have something to do with react-bootstrap.

I have found a similar question for react-native where the answers suggest to upgrade dependent libraries versions. I have done so but it didn't no help... I also removed node_modules completely and then reinstalled again.

I have looked into the issues on github but there ain't a similar one.

How can I correct my app and dismiss the warnings?

Versions I have:


  • react@15.3.0

  • react-bootstrap@0.30.2


Answer

I created this fiddle for you:

var Hello = React.createClass({
  render: function() {
    return <div><NavItem /></div>;
  }
});
ReactDOM.render(
  <Hello name="World" />,
  document.getElementById('container')
);

In general, it’s best that you try to do this as part of the question ;-)

I can’t reproduce the warning in that fiddle. If you copy and paste the code using React Bootstrap that triggers this warning, I’ll be happy to take another look.

Comments