Skip to content
Discussion options

You must be logged in to vote

If the child of Link is a functional component you have wrap the component in React.forwardRef

Try with this:

import React from 'react'
...
...
const Wrapper = React.forwardRef(({ onClick, children, href }, ref) => (
  <a href={href} onClick={onClick} ref={ref}>{children}</a>
))

Next.js docs

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@letterix
Comment options

Answer selected by letterix
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants