react-router
react-router copied to clipboard
[Bug]: react-router-dom-v5-compat not importing react-router-dom v5 in tests (DX)
What version of React Router are you using?
v5-compat
Steps to Reproduce
Import a Switch from "react-router-dom":
import { Switch } from "react-router-dom";
...
console.log({Switch});
act(() => {
ReactDOM.render(
<MemoryRouter initialEntries={["/home"]}>
<CompatRouter>
<Switch>
<CompatRoute path="home" element={<Home />} />
<CompatRoute path="/details" element={<Details />} />
</Switch>
</CompatRouter>
</MemoryRouter>,
node
);

Expected Behavior
After yarn install and yarn build (as CONTRIBUTING.md says) should install react-router-dom from packages/react-router-dom-v5-compat/package.json peerDependencies to permit usage and testability of CompatRoute and CompatRouter
Actual Behavior
Breaking my CompatRoute fail test on Switch usage (and CompatRouter useHistory() as well).
@Streeterxs Did you find a workaround for this?
This issue has been automatically marked stale because we haven't received a response from the original author in a while 🙈. This automation helps keep the issue tracker clean from issues that are not actionable. Please reach out if you have more information for us or you think this issue shouldn't be closed! 🙂 If you don't do so within 7 days, this issue will be automatically closed.