-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Convert week_number.jsx to flow (as a simple example) #1307
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
export default class WeekNumber extends React.Component<{ | ||
weekNumber: number, | ||
onClick?: Function | ||
}> { | ||
static propTypes = { | ||
weekNumber: PropTypes.number.isRequired, | ||
onClick: PropTypes.func | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we were to use babel-plugin-flow-react-proptypes, these propTypes
could be removed as they would be automatically generated from the types above.
Codecov Report
@@ Coverage Diff @@
## master #1307 +/- ##
==========================================
+ Coverage 88.79% 88.87% +0.08%
==========================================
Files 15 15
Lines 1044 1043 -1
Branches 171 171
==========================================
Hits 927 927
+ Misses 24 23 -1
Partials 93 93
Continue to review full report at Codecov.
|
Nice work 👍 |
Looks like the CI integration works, shall we go ahead and merge this? |
Workaround for react-docgen#125
@martijnrusschen Sure, this should be fine to merge. I was toying around with webpack integration, but unsure where it would be best. |
Good question, need to dive into that. I was planning on upgrading webpack as well, but haven't got the time to make this happen. |
* Convert week_number.jsx to flow (as a simple example) Workaround for react-docgen#125 * Run flow from lint script
This is a pretty minimal conversion. We could make
onClick
andhandleClick
be functions that take aSyntheticEvent
for stricter checking.