Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/reactjs/25.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Reactjs Eslint道具缺少与Formik的验证_Reactjs_Eslint_Formik - Fatal编程技术网

Reactjs Eslint道具缺少与Formik的验证

Reactjs Eslint道具缺少与Formik的验证,reactjs,eslint,formik,Reactjs,Eslint,Formik,我正在我的项目中使用Formik,现在我已经开始使用Eslint。我收到一大堆信息,比如说,“道具验证中缺少值”或“道具验证中缺少错误” 这些是Formik道具,我认为我不需要手动验证它们 您知道如何消除这些lint错误吗?请尝试通过定义propTypes并检查一下,谢谢您的回复!我已经试过了,问题是如果我做了PropTypes.array或PropTypes.object,那么我会得到另一个ESLint错误(例如“Prop-type-array是禁止的”)。对于这个错误,PropTypes.i

我正在我的项目中使用Formik,现在我已经开始使用Eslint。我收到一大堆信息,比如说,“道具验证中缺少值”或“道具验证中缺少错误”

这些是Formik道具,我认为我不需要手动验证它们


您知道如何消除这些lint错误吗?

请尝试通过定义propTypes并检查一下,谢谢您的回复!我已经试过了,问题是如果我做了PropTypes.array或PropTypes.object,那么我会得到另一个ESLint错误(例如“Prop-type-array是禁止的”)。对于这个错误,PropTypes.instanceOf(array)应该可以。谢谢Krina,我已经试过了,它消除了这个错误,但在故事的结尾我仍然得到了答案“PropType已定义但从未使用”。我认为这是因为我正在为我的功能组件道具指定PropType。然而,“真正”使用的道具来自Formik,通过渲染道具。这再次让我认为应该是Formik内部检查。。。