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

Explain "It appears you have provided a deprecated history object to" __v2_compatible__ #2866

Closed
gajus opened this issue Jan 7, 2016 · 1 comment

Comments

@gajus
Copy link

gajus commented Jan 7, 2016

I am getting an error:

Warning: [react-router] It appears you have provided a deprecated history object to <Router/>, please use a history provided by React Router with import { browserHistory } from 'react-router' or import { hashHistory } from 'react-router'. If you are using a custom, valid history please set history.__v2_compatible__ = true. See http://bit.ly/1Pxrl7E

I read the https://github.com/rackt/react-router/blob/master/upgrade-guides/v2.0.0.md#using-history-with-router

It is not clear whether it is discouraged to use history because of some incompatibilities or if there is another history package that should be used.

I prefer to have router and history packages separate, to promote separation of concerns.

@gajus
Copy link
Author

gajus commented Jan 7, 2016

Just found this https://github.com/rackt/react-router/blob/master/upgrade-guides/v2.0.0.md#using-custom-histories

// v2.0.0
import { Router, useRouterHistory } from 'react-router'
import { createHashHistory } from 'history'
// useRouterHistory creates a composable higher-order function
const appHistory = useRouterHistory(createHashHistory)({ queryKey: false })
<Router history={appHistory}/>

@gajus gajus closed this as completed Jan 7, 2016
@lock lock bot locked as resolved and limited conversation to collaborators Jan 22, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant