-
- Notifications
You must be signed in to change notification settings - Fork 10.8k
Closed
Labels
Description
Version
"react-router-dom": "^5.2.0", Test Case
For some peculiar reason this bug is not reproducible on CodeSandbox, please clone https://github.com/riwu/react-router-dom-bug instead.
import React from "react"; import { Router, Route } from "react-router-dom"; import { createBrowserHistory } from "history"; const history = createBrowserHistory(); export default function App() { return ( <Router history={history}> <Route exact path="/" component={() => ( <button onClick={() => history.push("/2")}>click</button> )} /> <Route path="/2" component={() => "page 2"} /> </Router> ); } Steps to reproduce
git clone https://github.com/riwu/react-router-dom-bug.gityarn installyarn start- Click the "click" button.
Expected Behavior
"page 2" should be rendered.
Actual Behavior
blank page is rendered.
karthicraghupathi, ivandjuricic, Jasioski, bachphuc, IamGondim and 2 more