Custom row component for Next.js Link #1432
Unanswered
markedwards
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
We have tables where each row should be entirely clickable, and links to a different route in our Next.js app. At the moment we use
router.push()
in anonClick()
handler inmuiTableBodyRowProps
. I'm looking for a solution which uses the Next.js<Link>
component instead, to take advantage of its prefetching feature.Is there a way to custom render the row, similar to the
Cell
prop of columns? The idea would be to wrap the row in a<Link>
component.An alternative is to add a hidden
<Link>
to a cell for prefetching, and continue usingrouter.push()
, but it would be nice to have a more elegant approach.Beta Was this translation helpful? Give feedback.
All reactions