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

Enter/leave the app (back button issue) #605

Open
johnelliott opened this issue Dec 10, 2017 · 0 comments
Open

Enter/leave the app (back button issue) #605

johnelliott opened this issue Dec 10, 2017 · 0 comments

Comments

@johnelliott
Copy link

johnelliott commented Dec 10, 2017

My app works server-rendered without javascript.
My app works properly when clicking links within app routes.

const app = choo()
app.route('/view/:image', detail) // <-- page with an image
//         /small/image.jpg <-- static image served by nginx
app.route('/', main) // <-- index page with grid of images

The problem I am having seems to be navigating in and out of the app to other sites or static files:

Steps to reproduce behavior

If I start at the index route /, then navigate via an <a> to another route of the app—/view/image.jpg—then click another <a> link, taking me to a static original file /static/image.jpg that's served from my static server I get unexpected behavior:

Expected behavior

I expect that clicking the back button goes back to /view/image.jpg.

Actual behavior

But actually clicking the back button goes to /.

It seems like my browser history has no knowledge of what happened when I was using Choo, and I'm sure the solution is something simple, but I've really struggled understanding what the intended approach to building apps with Choo is because there aren't many examples out there. I've found out I was doing too much with state/events, and needed to use routes and pages more, and that's taken me to this point.

@johnelliott johnelliott changed the title Dealing with back button after you leave the app Back button doesn't go back to previous route Dec 10, 2017
@johnelliott johnelliott changed the title Back button doesn't go back to previous route Back button doesn't go back to last route Dec 17, 2017
@johnelliott johnelliott changed the title Back button doesn't go back to last route Back button doesn't go back to previous route Dec 17, 2017
@johnelliott johnelliott changed the title Back button doesn't go back to previous route Enter/leave the app (back button issue) Jan 28, 2018
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

1 participant