Skip to content

[Bug]: Router type doesn't exist #9915

Closed Answered by brophdawg11
Beladric asked this question in Q&A
Discussion options

You must be logged in to vote

I agree this is a bit confusing. You're actually importing the <Router> component from react-router-dom there which is why it's giving you the "Router refers to a value" error. What you want is the Router type from the underlying @remix-run/router package which isn't at the moment re-exported through react-router-dom.

So you can import that directly, or just go with the ReturnType alias presented by @atfzl above.

https://www.typescriptlang.org/play?#code/JYWwDg9gTgLgBDAnmApnA3nAShArjFKOAXzgDMoIQ4ByAAShRGAA8BaKXAOwHpL9CNANwAoUJFgY4AY0YBDAgCFKAdwDOhHAKKkKVWvOkwOeAlDYATKsJEiANinj8zcALwz5S1RqhazACgBtdDAFAAsALloeGmIAXQBKUTgeHjgAPQB+WwcnU0IAJii-QjcPFAUUZQh1TXyoIJDwqJoY+KSRFLSszqA

Replies: 3 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by MichaelDeBoey
Comment options

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
4 participants
Converted from issue

This discussion was converted from issue #9911 on January 17, 2023 17:34.