We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
7.0.0-pre.2
react-router
import { createStub } from 'react-router/testing'
testing
package.json
According to the dev testing documentation, it should be possible to import from this package.
The build fails with
error TS2307: Cannot find module 'react-router/testing' or its corresponding type declarations. import { createStub } from 'react-router/testing'
The text was updated successfully, but these errors were encountered:
I think this is just a docs issue - try import { createRoutesStub } from "react-router"?
import { createRoutesStub } from "react-router"
Sorry, something went wrong.
Using the import { createRoutesStub } from "react-router" works 👍🏼 , but then I run into another issue.
According to the docs, I should also use route import. But when I do according to the docs, I run into TS issues.
route
Docs
const Stub = createStub([ route("/login", { Component: LoginForm, })
whereas real types for route expect 2nd argument to be file path.
file
ah ok yeah those route helpers don't make sense for testing (at least at the moment) - I'll update that in the docs too
const Stub = createStub([ { path:"/login", Component: LoginForm, } ]);
Successfully merging a pull request may close this issue.
What version of React Router are you using?
7.0.0-pre.2
Steps to Reproduce
react-router
package in version7.0.0-pre.2
.import { createStub } from 'react-router/testing'
testing
export in thepackage.json
definedExpected Behavior
According to the dev testing documentation, it should be possible to import from this package.
Actual Behavior
The build fails with
The text was updated successfully, but these errors were encountered: