Both next-routes and this lib provides a Link component in order to enable a better dev experience, the problem is how one should combine them together, the issue is that both Link components are using Next's Link component.
Maybe it is better to expose As attribute so the component that will be rendered will be the next-routes Link component.
One would be able to create a Combining Link, something like that:
import Link as I18nLink from '../i18n';
import Link as RoutesLink from '../routes';
export Link = ({children, ...rest}) => (
<I18nLink as={RoutesLink} {...rest}>{children}</I18nLink>
);
Maybe it should be the opposite, that nextRoutes Link component will expose that.
Just from reading the sourceCode of NextRoutes, I've found that it allows to get an external Link & Router.
https://github.com/fridays/next-routes/blob/master/src/index.js#L11
Hi @felixmosh - it's not recommended to use next-routes in conjunction with next-i18next, or really to use next-routes in general.
@isaachinman why?
How would you generate dynamic pages?
You can check the docs section on custom routing. The next-routes implementation is problematic last I checked - you can search issues in the NextJs repo.
@isaachinman why?
How would you generate dynamic pages?
Finally, how did you resolve this question. It troubled me a long time.
@weishiji next-routes allow you to pass Link Component & Router to the constructor, so, you can pass the next-i18next Link & Router to it.
@weishiji next-routes allow you to pass Link Component & Router to the constructor, so, you can pass the next-i18next Link & Router to it.
Can you give me a demo? I do not understand how he did it
@weishiji next-routes allow you to pass Link Component & Router to the constructor, so, you can pass the next-i18next Link & Router to it.
Can you give me a demo? I do not understand how he did it
Yes,I got it

Most helpful comment
Yes,I got it
