Internal issue 3065 - IcSideNavigation | State not updating
- Dominant language
- TypeScript
- Stars
- 53
- Forks
- 63
- Avg merge
- 2d 4h
- Merged PRs (30d)
- 15
Description
I'm working using the IcSideNavigation component, and in there I have the following IcNavigationItem:
TypeScript
{noformat}
{user.firstName} {user.lastName}
{noformat}
The user.firstName and user.lastName relate to a useUser hook I am calling to get the current user. When I set a new user however, the name does not update as expected, until the page is refreshed.
After trying out multiple things, I decided to put the exact same user.firstName and user.lastName code inside the exact same component, but in a div just outside of the IcSideNavigation, and the state updated as expected, but not within the IcSideNavigation.
Are you aware of anything that may cause blocking of state updates in the IcSideNavigation -> IcNavigationItem components?
Contributor guide
Research direction
Start by tracing the IcSideNavigation and IcNavigationItem rendering path and reproduce the difference between the navigation item and the adjacent div when the user changes. Compare their update behavior, then confirm the fix by showing that the displayed first and last names update without a page refresh and add regression coverage if the project’s existing component tests cover this path.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react, typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100