I thought I was starting to understand React Router, but I hit a new wall when adding a library that loads css for its components. Everything works fine when a navigate from
I hava a same problem.
Add a tag to the head of a page containing react-router's HTML using the default browserHistory
Load the page - history.js will output 2 errors, Warning: Automatically setting basename using is deprecated and will be removed in the next major release. The semantics of are subtly different from basename. Please pass the basename explicitly in the options to createHistory
Change the react-router history to use history where history is const history = useRouterHistory(createHistory)({ basename: 'http://whatever' }), which should fix the problem (as basename is now explicitly passed)
Reload the page
https://github.com/reactjs/react-router/issues/3387
5/9 update
In my case.
index.html
app.js
import { Router , useRouterHistory } from 'react-router'
import { createHistory } from 'history'
const browserHistory = useRouterHistory(createHistory)({ basename: '/' })
render(
,
document.getElementById("app")
);
And then reload the warning to disappears. hope this is useful.