Skip to content

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

Merged
merged 2 commits into from
Mar 31, 2018

Conversation

aij
Copy link
Contributor

@aij aij commented Mar 8, 2018

This is a pretty minimal conversion. We could make onClick and handleClick be functions that take a SyntheticEvent for stricter checking.

export default class WeekNumber extends React.Component<{
weekNumber: number,
onClick?: Function
}> {
static propTypes = {
weekNumber: PropTypes.number.isRequired,
onClick: PropTypes.func
};
Copy link
Contributor Author

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
Copy link

codecov bot commented Mar 8, 2018

Codecov Report

Merging #1307 into master will increase coverage by 0.08%.
The diff coverage is n/a.

Impacted file tree graph

@@            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
Impacted Files Coverage Δ
src/week_number.jsx 45.45% <ø> (+3.78%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ed55d2b...2d0c978. Read the comment docs.

@martijnrusschen
Copy link
Member

Nice work 👍

@martijnrusschen
Copy link
Member

Looks like the CI integration works, shall we go ahead and merge this?

@aij
Copy link
Contributor Author

aij commented Mar 28, 2018

@martijnrusschen Sure, this should be fine to merge.

I was toying around with webpack integration, but unsure where it would be best. server.js and webpack.docs.config.js are two options. Is webpack.config.js actually used anywhere?

@martijnrusschen
Copy link
Member

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.

@martijnrusschen martijnrusschen merged commit 8dab292 into Hacker0x01:master Mar 31, 2018
Squar89 pushed a commit to Squar89/react-datepicker2 that referenced this pull request Apr 10, 2019
* Convert week_number.jsx to flow (as a simple example)

Workaround for react-docgen#125

* Run flow from lint script
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants