The problem

HeaderMenuItem uses isCurrentPage to trigger the "selected" state for the component, whereas in SideNavMenuItem the prop isActive is used. This is sort of confusing to have different named props doing functionally similar things, all within the UIShell.

The solution

Updating this component to use the same prop would be a nice unification of the component APIs.

- [ ] Add `isActive` to HeaderMenuItem
- [ ] Infer it's value based on `isCurrentPage` (if provided)
- [ ] Deprecate `isCurrentPage`
- [ ] Remove `isCurrentPage` in v12

Examples

https://ibm-studios.slack.com/archives/C2K6RFJ1G/p1679052333819769

0

Hi @tay1orjones, I would like to work on this.

0

I took a look at the code and found out that the HeaderMenu component also uses the isCurrentPage to trigger the 'selected' state. I was wondering, shall I update this prop as well?

0

@pratikkarad yes, we should mirror these changes in both HeaderMenu and HeaderMenuItem. They can be bundled in the open PR

1
© 2022 pullanswer.com - All rights reserved.