You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Change Breadcrumbs to accept a single breadcrumb instead of an array (#7990)
### WHY are these changes introduced?
Breadcrumbs has only been using a single breadcrumb for a while now.
Instead of allowing consumers to pass an array without knowing why only
a single link is being used, we should remove the ability to pass an
array and make the component easier to understand implicitly.
### WHAT is this pull request doing?
UI will not change. The Breadcrumbs component was already only using the
last breadcrumb link in the array.
This PR changes the props for breadcrumbs and also the implementation on
the Page component.
### Migration path
Since this PR removes the `breadcrumbs[]` prop in favor of `breadcrumb`
all uses of Page, and Breadcrumbs will need to be migrated.
It will look something like this:
```ts
//before
const breadcrumbs = [
{
content: 'Products',
url: 'http://test.com',
},
];
<Page {...mockProps} breadcrumbs={breadcrumbs} />
//after
const breadcrumb = {
content: 'Products',
url: 'http://test.com',
};
<Page {...mockProps} breadcrumb={breadcrumb} />
```
### How to 🎩
Check the Breadcrumbs and Page components in storybook
### 🎩 checklist
- [ ] Tested on
[mobile](https://github.com/Shopify/polaris/blob/main/documentation/Tophatting.md#cross-browser-testing)
- [ ] Tested on [multiple
browsers](https://help.shopify.com/en/manual/shopify-admin/supported-browsers)
- [ ] Tested for
[accessibility](https://github.com/Shopify/polaris/blob/main/documentation/Accessibility%20testing.md)
- [ ] Updated the component's `README.md` with documentation changes
- [ ] [Tophatted
documentation](https://github.com/Shopify/polaris/blob/main/documentation/Tophatting%20documentation.md)
changes in the style guide
0 commit comments