File tree Expand file tree Collapse file tree 1 file changed +7
-8
lines changed Expand file tree Collapse file tree 1 file changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -61,20 +61,19 @@ export const SettingsSidebarNavItem: FC<SettingsSidebarNavItemProps> = ({
61
61
href,
62
62
end,
63
63
} ) => {
64
+ // useMatch is necessary to verify if the current path matches the href on the initial render of the route
64
65
const matchResult = useMatch ( href ) ;
65
66
66
67
return (
67
68
< NavLink
68
69
end = { end }
69
70
to = { href }
70
- className = { ( ) =>
71
- cn (
72
- "relative text-sm text-content-secondary no-underline font-medium py-2 px-3 hover:bg-surface-secondary rounded-md transition ease-in-out duration-150" ,
73
- {
74
- "font-semibold text-content-primary" : matchResult !== null ,
75
- } ,
76
- )
77
- }
71
+ className = { cn (
72
+ "relative text-sm text-content-secondary no-underline font-medium py-2 px-3 hover:bg-surface-secondary rounded-md transition ease-in-out duration-150" ,
73
+ {
74
+ "font-semibold text-content-primary" : matchResult !== null ,
75
+ } ,
76
+ ) }
78
77
>
79
78
{ children }
80
79
</ NavLink >
You can’t perform that action at this time.
0 commit comments