fridays / next-routes

Universal dynamic routes for Next.js
MIT License
2.47k stars 230 forks source link

Styling with styled-components #107

Closed dmbaranov closed 6 years ago

dmbaranov commented 6 years ago

Hi. I'm trying to use next-routes together with styled-components. Let's say my component with link looks like this:

const StyledLink = styled.a`
  ...
`;

...

<Link route="mainPage">
  <StyledLink>Main page</StyledLink>
</Link>

In this case there are no href on the a tag. But if instead of StyledLink I use <a className="my-link">Main page</a>, it works perfectly. Do you have any ideas how I can solve it? Thanks in advance!

andreaskeller commented 6 years ago

@dmt-13 you can use the passHref property https://github.com/zeit/next.js/issues/1942

dmbaranov commented 6 years ago

Awesome, thanks a lot! Sorry for opening this issue, didn't know about that property.