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

Make the back button work #26

Open
ddsnowboard opened this issue Mar 28, 2019 · 0 comments
Open

Make the back button work #26

ddsnowboard opened this issue Mar 28, 2019 · 0 comments

Comments

@ddsnowboard
Copy link
Collaborator

Right now, testing (and by extension, using) the app is a bit of a clusterfuck. It works, basically, and it looks nice, but every time I test creating a project, I have to refresh the page and login again to go to the search page and test. That's obviously not sustainable.

There are two options for fixing this, the classic twain of doing it ourselves and using a library. To do it ourselves, we'd basically have to have a big switch on some pages that just checks what the URL is and has a mapping to what should be shown. We'd set a listener on the back button using the History API and we'd have to push new stuff onto the History stack whenever we want to do anything. Getting everything to work together (if, for example, we have any nesting going on) could be tricky.

There's also React Router (https://reacttraining.com/react-router/web/guides/quick-start), which is common enough that I've heard of it and seems old enough to have had all the kinks worked out. You can look at the link to see how it works, but the idea is that you just declare the routes similar to an old-school backend-based solution and then it takes care of a lot for you. It doesn't hide things too aggressively, but it does simplify the occasionally complicated History API.

I usually hate dependencies, but I think in this specific situation that we should use React Router. If anyone has any strong opinions on which one of these we should do, or if we should do anything at all, speak now or forever hold your peace. Otherwise, I am going to start implementing this at the end of this week.

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