-
-
Notifications
You must be signed in to change notification settings - Fork 10.7k
History singletons #1429
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
History singletons #1429
Conversation
`new BrowserHistory()` shouldn't be inside the props decleration but outside the render method.
declaring the history outside of the render function
moved the history declaration outside of the `render` function.
…'react-router/lib/HashHistory'` this is an implementation for what @ryanflorence said on remix-run#1339 and @mjackson on remix-run#1426.
@mjackson, I decided on calling it |
modules/BrowserHistory.js
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
People who need to support IE8 (poor folks) are going to gripe about this. Let's just export var history = new BrowserHistory
in this module instead. Then people can still import { history }
and we'll be fine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Thanks for your work on this @Schniz ! |
💃 |
damn you IE 8. |
@mjackson fixed this 👍 |
the tests don't pass for some reason, and don't seem to be mine. should I rebase for the current master? |
Instead of just updating the docs, this is an implementation for what @ryanflorence said on #1339 and @mjackson on #1426.
this PR lets you use a history singleton with
BrowserHistory
andHashHistory
: