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: Button as component for react-router Link #26740

Merged
merged 1 commit into from
Sep 14, 2020

Conversation

knobo
Copy link
Contributor

@knobo knobo commented Sep 14, 2020

[中文版模板 / Chinese template]

🤔 This is a ...

  • New feature
  • Bug fix
  • Site / documentation update
  • Demo update
  • Component style update
  • TypeScript definition update
  • Bundle size optimization
  • Performance optimization
  • Enhancement feature
  • Internationalization
  • Refactoring
  • Code style optimization
  • Test Case
  • Branch merge
  • Other (about what?)

🔗 Related issue link

#26622 (except that this is for Button, not for Typography.Link)

💡 Background and solution

React router passes navigate as prop to component in . This is already fixed for Typography.Link.
(#26623) This fixes <Link to={to} component={Button} />

📝 Changelog

Language Changelog
🇺🇸 English Fix Button warning Invalid value for prop navigate when using with react-router.
🇨🇳 Chinese 修复 Button 和 react-router 一起使用时抛出 Invalid value for prop navigate 的问题。

☑️ Self Check before Merge

⚠️ Please check all items below before review. ⚠️

  • Doc is updated/provided or not needed
  • Demo is updated/provided or not needed
  • TypeScript definition is updated/provided or not needed
  • Changelog is provided or not needed

React router passes `navigate` as prop to component in <Link to={to}
component={Component}>. This is already fixed for Typography.Link.
(ant-design#26623) This fixes `<Link to={to} component={Button}` />
@ant-design-bot
Copy link
Contributor

ant-design-bot commented Sep 14, 2020

@ant-design-bot
Copy link
Contributor

ant-design-bot commented Sep 14, 2020

@codesandbox-ci
Copy link

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit d6c4cc6:

Sandbox Source
antd reproduction template Configuration

@knobo
Copy link
Contributor Author

knobo commented Sep 14, 2020

@afc163 afc163 merged commit e09040f into ant-design:master Sep 14, 2020
@knobo knobo deleted the button-as-link-component branch September 14, 2020 14:15
@zombieJ zombieJ mentioned this pull request Sep 20, 2020
15 tasks
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.

3 participants