How to unit test individual components that rely on routerState?
I'm attempting to unit test a component that relies on
Unfortunately I'm met with
Typically I would have a general wrapper that includes the Router with Routes, but this approach doesn't exactly work. I've referenced other Vitest rendering an empty div when RouterProvider is used, but that also doesn't work. Having the flexibility to test components as is would be nice without having to mock hooks that react-router provides
useMatchRoute. Unfortunately I'm met with
Typically I would have a general wrapper that includes the Router with Routes, but this approach doesn't exactly work. I've referenced other Vitest rendering an empty div when RouterProvider is used, but that also doesn't work. Having the flexibility to test components as is would be nice without having to mock hooks that react-router provides
Discord
Discord is the easiest way to communicate over voice, video, and text. Chat, hang out, and stay close with your friends and communities.