-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
breadcrumbs: remove styled and simplify #102980
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
base: master
Are you sure you want to change the base?
Conversation
❌ 2 Tests Failed:
View the top 2 failed test(s) by shortest run time
To view more test analytics, go to the Test Analytics Dashboard |
635c5c3 to
a46d84c
Compare
6188473 to
4c9059c
Compare
|
|
||
| if (!linkLastItem) { | ||
| if (crumbs[crumbs.length - 1]?.to) { | ||
| // We should not be mutating the crumbs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Immutability Broken: Props Mutated Directly
The code directly mutates the crumbs prop by setting crumbs[crumbs.length - 1]!.to = null, despite the comment explicitly stating "We should not be mutating the crumbs". This violates React's principle of immutability and can cause bugs if the same crumbs array is reused elsewhere or if the parent component re-renders with the same reference.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't make the rules here buddy, this existed before
Simplify breadcrumb component and add amplitude logging.