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: Breadcrumb itemRender not remove link even path is provided #42049

Merged
merged 6 commits into from
Apr 27, 2023

Conversation

zombieJ
Copy link
Member

@zombieJ zombieJ commented Apr 27, 2023

[中文版模板 / 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
  • Workflow
  • Other (about what?)

🔗 Related issue link

💡 Background and solution

fix #41994

📝 Changelog

Language Changelog
🇺🇸 English Fix Breadcrumb using itemRender with path render additional a element.
🇨🇳 Chinese 修复 Breadcrumb 使用 itemRender 并且配置 path 时,渲染元素会额外包一层 a 元素的问题。

☑️ Self-Check before Merge

⚠️ Please check all items below before requesting a reviewing. ⚠️

  • 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

🚀 Summary

🤖 Generated by Copilot at 52f7978

The pull request refactors the Breadcrumb and BreadcrumbItem components and their types, deprecates some props and introduces new ones, and extracts the rendering logic to a separate hook and function. The pull request also adds a test case and updates the documentation for the itemRender prop. These changes aim to simplify the code, improve type safety, and allow more flexibility and customization of the breadcrumb component.

🔍 Walkthrough

🤖 Generated by Copilot at 52f7978

  • Simplify and modularize the logic of rendering the breadcrumb item and name (link, link, link, link, link, link)
  • Update the type definitions and props of the Breadcrumb and BreadcrumbItem components (link, link, link, link, link, link)
  • Adjust the import order of cloneElement and ConfigContext in the Breadcrumb.tsx file to follow the alphabetical order (link)
  • Update the documentation and the usage of the items prop in the Breadcrumb component (link, link)

@github-actions
Copy link
Contributor

github-actions bot commented Apr 27, 2023

@github-actions
Copy link
Contributor

github-actions bot commented Apr 27, 2023

size-limit report 📦

Path Size
./dist/antd.min.js 376.02 KB (+111 B 🔺)
./dist/antd-with-locales.min.js 434.9 KB (+112 B 🔺)

@codecov
Copy link

codecov bot commented Apr 27, 2023

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (9a6aaac) 100.00% compared to head (cc3cf6a) 100.00%.

Additional details and impacted files
@@            Coverage Diff            @@
##            master    #42049   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          616       617    +1     
  Lines        10536     10604   +68     
  Branches      2885      2919   +34     
=========================================
+ Hits         10536     10604   +68     
Impacted Files Coverage Δ
components/breadcrumb/Breadcrumb.tsx 100.00% <100.00%> (ø)
components/breadcrumb/BreadcrumbItem.tsx 100.00% <100.00%> (ø)
components/breadcrumb/useItemRender.tsx 100.00% <100.00%> (ø)
components/breadcrumb/useItems.ts 100.00% <100.00%> (ø)

... and 2 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

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.

Breadcrumbs V5 render issue
2 participants