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

Replace react-breadcrumbs with custom component #2207

Merged
merged 3 commits into from
Dec 1, 2021
Merged

Conversation

grahamalama
Copy link
Contributor

@grahamalama grahamalama commented Nov 30, 2021

Closes #2181

React Breadcrumbs was causing us some headaches since it specifies React version 15.x or 16.x as a peer dependency. Its last commit was made in 2019, so it appears to be abandoned.

We weren't really using much from this package and it was easy enough to roll our own breadcrumbs component, so this PR does just that.

While working on this PR, I noticed that history was bumped to version 5.x (which is incompatible with connected-react-router), so this PR also includes a downgrade of history to major version 4.

Before:
Screen Shot 2021-12-01 at 9 18 18 AM

After:
Screen Shot 2021-12-01 at 9 21 10 AM

@grahamalama grahamalama marked this pull request as ready for review December 1, 2021 14:16
Copy link
Contributor

@matt-boris matt-boris left a comment

Choose a reason for hiding this comment

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

🎉

* "/foo" => [["home", "/"], ["foo", "/foo"]]
* "/foo/bar" => [["home", "/"], ["foo", "/foo"], ["bar", "/foo/bar"]]
*/
export function breadcrumbifyPath(path: string) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice!

Copy link
Contributor

@leplatrem leplatrem left a comment

Choose a reason for hiding this comment

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

💯 great job

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.

Find alterrnative to react-breadcrumbs (abandonned?)
3 participants