Categories
React Answers

How to fix ESLint error missing in props validation with React?

Spread the love

Sometimes, we want to fix ESLint error missing in props validation with React

In this article, we’ll look at how to fix ESLint error missing in props validation with React.

How to fix ESLint error missing in props validation with React?

To fix ESLint error missing in props validation with React, we can add a comment or disable the rule globally with a config.

For instance, we write

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

to disable prop type check for the line immediately below the comment in our code.

Or we can add

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

in .eslintrc to disable the prop type validation rule for the whole project.

Conclusion

To fix ESLint error missing in props validation with React, we can add a comment or disable the rule globally with a config.

By John Au-Yeung

Web developer specializing in React, Vue, and front end development.

Leave a Reply

Your email address will not be published. Required fields are marked *