Migrate deprecated attribute activeClassname
This commit is contained in:
parent
30e458c547
commit
0ede7cf3c9
|
@ -6,13 +6,16 @@ type NavTabProps = {
|
||||||
href: string;
|
href: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
// TODO: migrate activeClassName because of: https://github.com/remix-run/react-router/releases/tag/v5.3.0
|
|
||||||
// TODO: @types/react-router-dom still doesn't support function in className
|
|
||||||
const NavTab: React.FC<NavTabProps> = ({ href, children }) => (
|
const NavTab: React.FC<NavTabProps> = ({ href, children }) => (
|
||||||
<Tab as={Fragment}>
|
<Tab as={Fragment}>
|
||||||
<NavLink
|
<NavLink
|
||||||
className="text-gray-500 border-transparent hover:text-link-blue text-sm font-bold px-3 py-3 border-b-2"
|
className={(isActive) =>
|
||||||
activeClassName="text-link-blue border-link-blue"
|
`${
|
||||||
|
isActive
|
||||||
|
? "text-link-blue border-link-blue"
|
||||||
|
: "text-gray-500 border-transparent"
|
||||||
|
} hover:text-link-blue text-sm font-bold px-3 py-3 border-b-2`
|
||||||
|
}
|
||||||
to={href}
|
to={href}
|
||||||
exact
|
exact
|
||||||
replace
|
replace
|
||||||
|
|
Loading…
Reference in New Issue