tomchentw / react-toastr

React.js toastr component
https://tomchentw.github.io/react-toastr/
MIT License
619 stars 112 forks source link

Warning: You are manually calling a React.PropTypes validation #75

Closed julienbachmann closed 7 years ago

julienbachmann commented 8 years ago

This warning

warning.js:36 Warning: You are manually calling a React.PropTypes validation function for the `id` prop on `ToastContainer`. 
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. 
See https://fb.me/react-warning-dont-call-proptypes for details.

is raised with recent version of React when I use ToastContainer.

RangarajKaushikSundar commented 8 years ago

@julienbachmann Thank you for your comment. This has to be handled ASAP in order for the toastr to be functional with latest versions of React.

Kindly share with us if you will be able to create a pull request for the same.

Happy coding, Kaushik

austinnichols101 commented 8 years ago

Also seeing the message with 0.14.8. Screenshot below.

image

ghost commented 8 years ago

I'm seeing the same issue. Is there a fix for it or will be be fixed in a coming release?

tomchentw commented 8 years ago

I don't see this error in the latest code. The demo app is now created by create-react-app. Could you check it and let me know how to reproduce it?

ghost commented 8 years ago

It is strange. I'm running the latest version or react-toastr from npm (see below) but I still see the error messages. Not sure what is going on.

redux-simple-starter@1.0.0
└─┬ react-bootstrap-table@2.5.5
  └── react-toastr@2.8.1

In the bundle.js I can see

    ToastContainer.propTypes = {
      toastType: _react.PropTypes.shape({
        error: _react.PropTypes.string,
        info: _react.PropTypes.string,
        success: _react.PropTypes.string,
        warning: _react.PropTypes.string
      }).isRequired,
      id: _react.PropTypes.string.isRequired,
      toastMessageFactory: _react.PropTypes.func.isRequired,
      preventDuplicates: _react.PropTypes.bool.isRequired,
      newestOnTop: _react.PropTypes.bool.isRequired,
      onClick: _react.PropTypes.func.isRequired

I'll try to make a small repo later for you to try.

tomchentw commented 8 years ago

Could it be an error in react-bootstrap-table?

tomchentw commented 7 years ago

Cannot repro. Close now.