Should I use createRoutesStub when using React Router as a library? #12576
Unanswered
ArthurGuez
asked this question in
Q&A
Replies: 1 comment
-
Yes, the helper will helps you test components using hooks and components from RR without mocking them as they depend on RR context. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello there,
I'm trying to update React Router to v7 and I've noticed that the only doc page regarding testing is in the "Framework" section. It suggests to use
createRoutesStub
when your component depends on things likeuseLoaderData
or<Link>
.As of now, I was using that little abstraction to test such components:
I plan to use React Router v7 as a library for now, does that mean there is no need to update my tests with
createRoutesStub
?Thanks,
Beta Was this translation helpful? Give feedback.
All reactions