i got this problem in the console, i tried refactoring my code and 2 things broke:
the links routing doesnt work when i dont pass in a callback function, and i got this console error error too
so the questions are:
1.how do i fix the console error?
- whats wrong with my 'exact to' template string? doesnt change the url,
the component:
const { NavLink } = ReactRouterDOM;
export function SingleNavLink(props){
const {url,name,onCategoryChange}=props
const linkorbutton=(onCategoryChange)?`exact to=${url}`:`onClick={onCategoryChange(name.toLowerCase())}`
return(
<NavLink linkorbutton>
{name}
</NavLink>
)