close

[Solved] react/prop-types X; is missing in props validation

Today I am trying to use PropType But I am facing the following error: react/prop-types X; is missing in props validation in ReactJS. In this Exerror article, We are going to learn about How to reproduce this error and we will discuss All Possible Solutions Let’s Get Start with This Article.

How react/prop-types X; is missing in props validation Error Occurs?

I am trying to use PropType But I am facing the following error.

react/prop-types children; is missing in props validation

So here I am writing all the possible solutions that I have tried to resolve this error.

How To Solve react/prop-types X; is missing in props validation Error?

  1. How To Solve react/prop-types X; is missing in props validation Error?

    To Solve react/prop-types X; is missing in props validation Error Open your eslintrc.json file and add react/prop-types rule in rule section Just like this: “rules”: { “react/prop-types”: “off” } And now, You are disabled your react/prop-types for Project. Now your error must be solved.

  2. react/prop-types X; is missing in props validation

    To Solve react/prop-types X; is missing in props validation You just need to disable react/prop-types in Your Code. By disabling react/prop-types your error will be resolved. Just open your Code file And Place the Below Line Above Your code Just Like: /* eslint-disable react/prop-types */ For Example, I am facing an error in My App.js File Then I Have to Add This Comment in my App.js top of My Code: /* eslint-disable react/prop-types */ import React from ‘react’; Now, Your error must be solved. Thank You.

Solution 1: disable react/prop-types

To Solve react/prop-types X; is missing in props validation You just need to disable react/prop-types in Your Code. By disabling react/prop-types your error will be resolved. Just open your Code file And Place the Below Line Above Your code Just Like.

/* eslint-disable react/prop-types */

For Example, I am facing an error in My App.js File Then I Have to Add This Comment in my App.js top of My Code.

/* eslint-disable react/prop-types */
import React from 'react';

class App extends React.Component {
......

Now, Your error must be solved. Thank You.

Solution 2: Change eslintrc

Open your eslintrc.json file and add react/prop-types rule in rule section Just like this.

"rules": {
  "react/prop-types": "off"
}

And now, You are disabled your react/prop-types for Project. Now your error must be solved.

Conclusion

It’s all About this error. I hope We Have solved Your error. Comment below Your thoughts and your queries. Also, Comment below which solution worked for you?

Also, Read

Leave a Comment