Skip to content
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

fix: typescript React import #3179

Merged
merged 3 commits into from
Apr 25, 2019
Merged

fix: typescript React import #3179

merged 3 commits into from
Apr 25, 2019

Conversation

ycjcl868
Copy link
Contributor

@ycjcl868 ycjcl868 commented Apr 17, 2019

Close #3178.

First of all, thank you for your contribution! :-)

Please makes sure that these checkboxes are checked before submitting your PR, thank you!

  • Make sure that you follow antd's code convention.
  • Run npm run lint and fix those errors before submitting in order to keep consistent code style.
  • Rebase before creating a PR to keep commit history clear.
  • Add some descriptions and refer relative issues for you PR.

Extra checklist:

if isBugFix :

  • Make sure that you add at least one unit test for the bug which you had fixed.

elif isNewFeature :

  • Update API docs for the component.
  • Update/Add demo to demonstrate new feature.
  • Update TypeScript definition for the component.
  • Add unit tests for the feature.

This change is Reviewable

@ghost ghost assigned ycjcl868 Apr 17, 2019
@ghost ghost added the In Progress label Apr 17, 2019
@codecov
Copy link

codecov bot commented Apr 17, 2019

Codecov Report

Merging #3179 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #3179   +/-   ##
=======================================
  Coverage   60.05%   60.05%           
=======================================
  Files          92       92           
  Lines        2278     2278           
  Branches      654      654           
=======================================
  Hits         1368     1368           
  Misses        901      901           
  Partials        9        9
Flag Coverage Δ
#web 60.05% <100%> (ø) ⬆️
Impacted Files Coverage Δ
components/date-picker/index.tsx 62.85% <ø> (ø) ⬆️
components/badge/index.tsx 100% <ø> (ø) ⬆️
components/slider/index.tsx 100% <ø> (ø) ⬆️
components/progress/index.tsx 78.94% <ø> (ø) ⬆️
components/modal/alert.tsx 0% <ø> (ø) ⬆️
components/steps/index.tsx 76.08% <ø> (ø) ⬆️
components/calendar/index.tsx 100% <ø> (ø) ⬆️
components/picker/index.tsx 100% <ø> (ø) ⬆️
components/card/index.tsx 100% <ø> (ø) ⬆️
components/input-item/CustomKeyboard.tsx 4.44% <ø> (ø) ⬆️
... and 61 more

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 869e8ad...5dba823. Read the comment docs.

@ziluo ziluo requested a review from doxiaodong April 18, 2019 11:53
@doxiaodong
Copy link
Contributor

Not enough since rmc-xxx isn't be changed

@ycjcl868
Copy link
Contributor Author

@doxiaodong There have no effect for developers using antd-mobile.

@doxiaodong
Copy link
Contributor

@ycjcl868 some declare types is defined by rmc-xxx

@ycjcl868
Copy link
Contributor Author

ycjcl868 commented Apr 18, 2019

What files ?
Most of the components' types define in antd-mobile.

@doxiaodong
Copy link
Contributor

Thank you . also change import * as PropTypes from 'prop-types'; ?

@ycjcl868
Copy link
Contributor Author

ycjcl868 commented Apr 22, 2019

@doxiaodong It doesn't matter to developers using antd-mobile, it's just for antd-mobile developers. In addition, allowSyntheticDefaultImports was enabled in antd-mobile tsconfig.json, so there is no need to change PropTypes.

@doxiaodong
Copy link
Contributor

prop-types will be used by user since typescript will identify static propTypes in component, so it's need to change it.

@ycjcl868
Copy link
Contributor Author

ok,

package.json Outdated
@@ -35,6 +35,7 @@
"babel-runtime": "6.x",
"classnames": "^2.2.1",
"normalize.css": "^7.0.0",
"prop-types": "^15.7.2",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove this. the prop-types should be chosen by users

Copy link
Contributor

@doxiaodong doxiaodong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@doxiaodong
Copy link
Contributor

doxiaodong commented Apr 23, 2019

#3186 这个先合吧, [email protected] 修正后导致 compile 不过了.

@doxiaodong doxiaodong merged commit 20887a3 into master Apr 25, 2019
@delete-merged-branch delete-merged-branch bot deleted the fix-ts-react branch April 25, 2019 01:30
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.

React should import * as
2 participants