Migrate deprecated attribute activeClassname
This commit is contained in:
parent
30e458c547
commit
0ede7cf3c9
|
@ -6,13 +6,16 @@ type NavTabProps = {
|
|||
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 }) => (
|
||||
<Tab as={Fragment}>
|
||||
<NavLink
|
||||
className="text-gray-500 border-transparent hover:text-link-blue text-sm font-bold px-3 py-3 border-b-2"
|
||||
activeClassName="text-link-blue border-link-blue"
|
||||
className={(isActive) =>
|
||||
`${
|
||||
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}
|
||||
exact
|
||||
replace
|
||||
|
|
Loading…
Reference in New Issue