Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PropTypes validators directly is not supported from `TreeView`, `ObjectInspector`, `ConnectedTreeNode`, `ObjectRootLabel`, `ObjectPreview`

Tags:

reactjs

I'm getting this PropTypes validators directly is not supported warning for these components TreeView, ObjectInspector, ConnectedTreeNode, ObjectRootLabel, ObjectPreview, but I don't know what library these components belong to.

How can I get rid of these warnings?

Warning: Failed Context Types: Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Check the render method of `TreeView`.
Warning: Failed Context Types: Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Check the render method of `ObjectInspector`.
Warning: Failed Context Types: Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Check the render method of `ConnectedTreeNode`.
Warning: Failed Context Types: Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Check the render method of `ObjectRootLabel`.
Warning: Failed Context Types: Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Check the render method of `ObjectPreview`.
like image 563
ThomasReggi Avatar asked Jun 13 '17 01:06

ThomasReggi


3 Answers

Even I got the same issue but both react and prop-types package was up to date.

I had written

visibility: PropTypes.bool()

instead of

visibility: PropTypes.bool

I was using the PropTypes type as functions so it was throwing the error.

like image 90
Harish V Avatar answered Nov 01 '22 04:11

Harish V


Use search in your project files to find the libraries in which these components are located. Here are some I found using Google Search:

  • TreeView - react-treeview
  • ObjectInspector - react-object-inspector
  • ObjectRootLabel - react-inspector

Try to download the last versions of these libraries to see if they fix these warnings. If not, you can create a PR/issue or just wait when someone will fix it.

Btw, in production build of your React app these warnings will disappear.

like image 1
GProst Avatar answered Nov 01 '22 06:11

GProst


You are getting this errors because a component library that is using prop-types package has been updated, but your version of React is not compatible with it, you will have to update React to version 15.3.0 or to latest version. check here for more info

like image 1
Uziel Valdez Avatar answered Nov 01 '22 04:11

Uziel Valdez