Skip to content

Using typesafe router properties in your own compoent props #635

Answered by sjiep
sjiep asked this question in Q&A
Discussion options

You must be logged in to vote

Well, I stumbled on this Q&A discussion #429 which basically answer my question.

The following worked for me on version 0.0.1-beta.104, assuming my ButtonLink component in the OP:

interface ButtonLinkProps {
  to: MakeLinkOptions['to']
  children: string
}

or if we simply want all props that can be provided to a Link

interface ButtonLinkProps extends MakeLinkOptions {
  children: string
}

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by sjiep
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant