Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warning: <BrowserRouter> ignores the history prop #53

Closed
entozoon opened this issue May 13, 2021 · 3 comments
Closed

Warning: <BrowserRouter> ignores the history prop #53

entozoon opened this issue May 13, 2021 · 3 comments

Comments

@entozoon
Copy link

This annoying warning is popping up, with react 17.0.2 and react-router-dom 5.2.0
It all works fine, and is a great little package but yeah, any ideas of a workaround to get rid of the warning?

Typically this is what I'm working with:

import { BrowserRouter, Route } from "react-router-dom";
import { LastLocationProvider } from "react-router-last-location";
 <BrowserRouter>
  <LastLocationProvider>
    <Route>
      ...

I've tried this, as some people have suggested, but it's the same result unfortunately:

import { BrowserRouter, Route } from "react-router-dom";
import { LastLocationProvider } from "react-router-last-location";
import { createBrowserHistory } from "history";
const history = createBrowserHistory();
 <BrowserRouter history={history}>
  <LastLocationProvider>
    <Route>
      ...

Perhaps it's just something that'll be fixed in due course or even some issue with react-router-dom? Who knows, but a cheeky workaround would be handy

@hinok
Copy link
Owner

hinok commented May 14, 2021

@entozoon Hey 👋, can you prepare a small reproduction demo on codesandbox?
I'd really speed up resolving the issue on my side.

@entozoon
Copy link
Author

Oh dude @hinok , I'm so sorry. My issue was with another package!
react-delay-link (and it's not the first time I've had PRs out to fix that package).

I can only apologise, and thank you for the codesandbox tip - it helped me get to the root of the problem!

@hinok
Copy link
Owner

hinok commented May 14, 2021

@entozoon I'm glad that I was even able to help 😅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants