Reactjs “TreeView”、“ObjectInspector”、“ConnectedTreeNode”、“ObjectRootLabel”、“ObjectPreview”不支持直接使用PropTypes验证器`
我直接得到的是,这些组件不支持Reactjs “TreeView”、“ObjectInspector”、“ConnectedTreeNode”、“ObjectRootLabel”、“ObjectPreview”不支持直接使用PropTypes验证器`,reactjs,Reactjs,我直接得到的是,这些组件不支持PropTypes验证程序警告TreeView,ObjectInspector,ConnectedTreeNode,ObjectRootLabel,ObjectPreview,但我不知道这些组件属于哪个库 我怎样才能摆脱这些警告 Warning: Failed Context Types: Calling PropTypes validators directly is not supported by the `prop-types` package. Use `
PropTypes验证程序警告TreeView
,ObjectInspector
,ConnectedTreeNode
,ObjectRootLabel
,ObjectPreview
,但我不知道这些组件属于哪个库
我怎样才能摆脱这些警告
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`.
在项目文件中使用“搜索”查找这些组件所在的库。以下是我使用谷歌搜索找到的一些:
TreeView
-
ObjectInspector
-
ObjectRootLabel
-
请尝试下载这些库的最新版本,以查看它们是否修复了这些警告。如果没有,您可以创建一个PR/问题,或者等待有人修复它
顺便说一句,在您的React应用程序中,这些警告将消失。您收到此错误是因为使用prop types软件包的组件库已更新,但您的React版本与之不兼容,您必须将React
更新为15.3.0
版本或最新版本。查看更多信息即使我收到了相同的问题,但react和道具类型软件包都是最新的
我写过
visibility: PropTypes.bool()
而不是
visibility: PropTypes.bool
我使用PropTypes类型作为函数,所以它抛出了错误