-
Notifications
You must be signed in to change notification settings - Fork 961
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
Drop "cannot go" invariant in createMemoryHistory #165
Comments
Ref #89, and transitively remix-run/react-router#767 and remix-run/react-router#843. I don't think this can be resolved by #36. I don't have the time right now to fully read through those refs to understand why |
Well, there is the
|
Are you using |
Yep. |
Ah! Okay. That's quite relevant! |
Can you just wrap the whole thing in |
I can, but it's kinda ugly. |
I'm on board with replacing the This is technically a breaking change, though, so we'd have to defer it for 2.x. @rackt/routing, what do we think of dropping that invariant to make |
goBack
? Otherwise the invariant crashes my app in Electron.
I like your suggestion of dropping the |
|
The I'd like to expose |
I'll look at replacing it with a |
Actually, @petrbrzek, do you want to put together a PR? I'm a bit busy the next few weeks, have a conference and a deadline coming up. |
@taion Sure. What about this?
|
Just |
But otherwise that's exactly what I was thinking. I don't know what test coverage around that looks like though - not sure what we need there either. |
Shouldn't need a test. Simple replace with a warning is fine. On Wed, Dec 2, 2015 at 8:02 PM Jimmy Jia [email protected] wrote:
|
👍 |
@mjackson how can we avoid this if the history doesn't expose a length or a canGo method? Geniunely asking - there seem to be 100 different issues related to this but no real solution. |
@tommoor What are you trying to do? As in, what feature or app are you trying to build? The reason I ask is because we're too far down in the weeds of this discussion when we start talking about API that we need but that we just can't provide. |
@mjackson - that's fair - I'm trying to provide back and forward buttons in our app that are disabled correctly when you wouldn't be able to navigate in the direction because you are at the start or end of the history. |
Maybe we could just expose |
That would certainly resolve it for us as we're using the memory history - it's an Electron app in this case. Is there a lot of work to achieve that? |
You'd get something like this with |
Mmmmmm, yes. If we had |
Is it important to throw an error if I cannot
goBack
? It seems to me that returningnull
should be just fine.The text was updated successfully, but these errors were encountered: