'foo' is missing in props validation (react/prop-types)
See original GitHub issueI was having trouble with this (‘post’ is missing in props validation (react/prop-types)):
export default Post = ({ post }) => (
<div>{post.title}</div>
);
Post.propTypes = {
post: PropTypes.arrayOf(PropTypes.object).isRequired,
};
but this did not have anymore issues:
const Post = ({ post }) => (
<div>{post.title}</div>
);
Post.propTypes = {
post: PropTypes.arrayOf(PropTypes.object).isRequired,
};
export default Post;
And I believe this information could be useful:
armenzg@armenzg-mbp readable-app$ node --version
v8.5.0
armenzg@armenzg-mbp readable-app$ ./node_modules/.bin/eslint --version
v4.7.2
armenzg@armenzg-mbp readable-app$ cat package.json | grep eslint
"lint": "./node_modules/.bin/eslint src/",
"eslint": "^4.7.2",
"eslint-config-airbnb": "^15.1.0",
"eslint-plugin-import": "^2.7.0",
"eslint-plugin-jsx-a11y": "^5.1.1",
"eslint-plugin-react": "^7.3.0"
armenzg@armenzg-mbp readable-app$ cat .eslintrc.js
module.exports = {
"extends": "airbnb",
"rules": {
"react/jsx-filename-extension": [1, { "extensions": [".js", ".jsx"] }],
"no-undef": "off",
"no-console": "off"
}
};
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:10 (6 by maintainers)
Top Results From Across the Web
React eslint error missing in props validation - Stack Overflow
It can not correctly detect what props were mentioned in propTypes if you have annotated named objects via destructuring anywhere in the class....
Read more >'(react/prop-types): Missing in props validation' when ... - GitHub
This will give me the error that the props validation is missing. '...' is missing in props validation eslint(react/prop-types) ...
Read more >How to fix: Prop types validation error - is missing in props ...
To fix the 'React eslint error missing in props validation' when developing a React app, we can set the prop types of the...
Read more >is missing in props validation(react/prop-types) - You.com
ESLint is just warning you to define a type check for that prop in the component where you are using it. You can...
Read more >[React] Solution for 'children' is missing in props validation ...
If you came up with this error message “ 'children' is missing in props validation eslint(react/prop-types)” , this article might help.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
FWIW (not sure if this is a good indicator of the real situation in this case) Babel transpiles this to
and then
is a runtime ReferenceError in strict mode.
@ljharb done in #1583