react/prop-types doesn't work with fragment syntax
See original GitHub issueExample:
import React from "react";
const ForAttendees = ({ page }) => (
<>
<section className="intro intro_attendees">{page}</section>
<div className="grid--5col">barfoo</div>
</>
);
export default ForAttendees;
react/prop-types
does not capture this. If you replace the fragment syntax with divs, it detects the case.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:4
- Comments:7 (4 by maintainers)
Top Results From Across the Web
react/prop-types doesn't work with fragment syntax · Issue #1694 ...
Example: import React from "react"; const ForAttendees = ({ page }) => ( <> {page} barfoo ); export default ForAttendees; react/prop-types does no......
Read more >Typechecking With PropTypes - React
To run typechecking on the props for a component, you can assign the special propTypes property: import PropTypes from 'prop-types'; class Greeting extends ......
Read more >Flow errors on <React.Fragment> or <></>, but not <Fragment>
I would like to use the <></> Fragment shorthand syntax, and this issue is stopping me from doing that for now. When I...
Read more >How to validate React props using PropTypes - LogRocket Blog
Learn how to validate props with React PropTypes, React's internal mechanism for adding type checking to component props.
Read more >How to forget about type errors in your React props with ...
Using prop types in React gives you a bit of the TypeScript experience at runtime without having to use TypeScript. The problem. The...
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
FYI, babel 7 got released
See #1956