Material-ui: Deprecated use of PropTypes validation functions

Created on 30 Jul 2016  路  25Comments  路  Source: mui-org/material-ui

Problem description

With React 15.3.0 the maintainers appear to have deprecated use of PropTypes validation functions.

Steps to reproduce

When using components, e.g. Slider, and passing a prop such as defaultValue, I see error messages like the following:

"ERROR: 'Warning: You are manually calling a React.PropTypes validation function for the defaultValue prop on Slider. 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.'"

Similar warnings are printed for List and EnhancedButton.

Versions

  • Material-UI: master (2d69cb1)
  • React: 15.3.0
  • Browser: Chrome
bug 馃悰

Most helpful comment

Please push to NPM as soon as possible :)

All 25 comments

Same happend to me with AppBar component.

Warning: You are manually calling a React.PropTypes validation function for the linkButton prop on EnhancedButton. 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.

React: 15.2.1

@jacksonrayhamilton Thanks for raising this issue.

Whoops, looks like the PropTypes calls for Slider were missed?

@jacksonrayhamilton Good catch. Do you want to submit a PR?

Sure, but I don't know how it should be fixed. typeof props[propName] === 'number' and return an error in the same format as the PropTypes functions?

@jacksonrayhamilton Basically, you need to spread the arguments to the next function.

I think this is also happening for List components.

@Nesciosquid I'm not seeing that on master with my instance of List. Nor do I see PropTypes being called in those components. Do you have conditions to reproduce on master?

There are PropType validation warnings still being thrown for TextField & SelectField components as well.

Ah, I'm using the latest npm build.

Please push to NPM as soon as possible :)

Hello, I've just installed the newest React and Material-UI and I've got the same for the Chip components as well http://www.material-ui.com/#/components/chip

screen shot 2016-08-02 at 21 47 08

Here's a list of warnings I get after upgrade:

Warning: You are manually calling a React.PropTypes validation function for the `linkButton` prop on `EnhancedButton`.
Warning: You are manually calling a React.PropTypes validation function for the `onEnterKeyDown` prop on `TextField`.
Warning: You are manually calling a React.PropTypes validation function for the `animated` prop on `Menu`.
Warning: You are manually calling a React.PropTypes validation function for the `openDirection` prop on `Menu`.
Warning: You are manually calling a React.PropTypes validation function for the `unCheckedIcon` prop on `Checkbox`.

I'm pretty sure there's more to that list.

Hi guys, I am experiencing the same problem with react 0.28.0. Do you have any suggestion?

I'm having the same problem

I was able to solve this problem by downgrading react version to 15.2.1

Got the same problem for react v15.3.0 and material-ui v0.15.2.
Update: confirm fixed in v0.15.3. Thanks!

I had the same problem with react-sparklines, I checked npm that had version 2.8.xx. Then, trying to upgrade my npm to 3.10.5 and no more warning :")

problem is you need the latest version of npm. To do this go to https://nodejs.org and download the most current version (should say Current next to it). After install, type in npm -v into your console and it should be 3.10.3 or above. then go to the repo where you have your sparklines installed and run npm install, npm update. try starting your app again and you should not get any more console errors.

you can also: npm install -g npm

I am using npm 3.10.5, but still got the warning.

Not working on npm 3.10.5, issue seems to be occuring if you split the Listitem into a different component and use a Divider or Subheader there.

This same issue appears on SvgIcon as well, and is throwing a bunch of errors:

Warning: You are manually calling a React.PropTypes validation function for the children prop on SvgIcon. This is deprecated and will not work in production with 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.

Warning: You are manually calling a React.PropTypes validation function for the color prop on SvgIcon. This is deprecated and will not work in production with 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.

Warning: You are manually calling a React.PropTypes validation function for the hoverColor prop on SvgIcon. This is deprecated and will not work in production with 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.

Warning: You are manually calling a React.PropTypes validation function for the onMouseEnter prop on SvgIcon. This is deprecated and will not work in production with 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.

Warning: You are manually calling a React.PropTypes validation function for the onMouseLeave prop on SvgIcon. This is deprecated and will not work in production with 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.

Warning: You are manually calling a React.PropTypes validation function for the style prop on SvgIcon. This is deprecated and will not work in production with 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.

Warning: You are manually calling a React.PropTypes validation function for the viewBox prop on SvgIcon. This is deprecated and will not work in production with 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.

Warning: You are manually calling a React.PropTypes validation function for the muiTheme prop on SvgIcon. This is deprecated and will not work in production with 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.

I have same issue.

warning.js?6327:33 Warning: You are manually calling a React.PropTypes validation function for the `path` prop on `Route`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details.
warning.js?6327:33 Warning: You are manually calling a React.PropTypes validation function for the `component` prop on `Route`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details.
warning.js?6327:33 Warning: You are manually calling a React.PropTypes validation function for the `components` prop on `Route`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details.
warning.js?6327:33 Warning: You are manually calling a React.PropTypes validation function for the `getComponent` prop on `Route`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details.
...............

@imperio-wxm Please post support requests, whether for Material-UI or as in this case, for your own code, in the appropriate channels. GitHub issues is not a support forum. Thanks!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

anthony-dandrea picture anthony-dandrea  路  3Comments

ryanflorence picture ryanflorence  路  3Comments

finaiized picture finaiized  路  3Comments

chris-hinds picture chris-hinds  路  3Comments

TimoRuetten picture TimoRuetten  路  3Comments