You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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.
The text was updated successfully, but these errors were encountered: