I’m currently building my first SPA on bubble. I’m having a bit of an issue when it comes to routing.
Say a user “navigates” to the /timetable “page”. I load that section of the page and update the url to https://website.com/timetable
Since it’s an SPA, the user never actually leaves the page, however, if the user reloads the page (or I update the app forcing a reload), they are brought to the 404 page.
Is there a way to solve this problem? Does bubble have a SPA toggle to let it konw that it’s a single page app?
Hey! The issue happens because Bubble doesn’t natively treat SPA URLs like typical frameworks. To fix this, use URL parameters like ?tab=timetable instead of paths, so Bubble knows where to load on refresh. Alternatively, plugins like Pathfinder can help manage paths for SPA
URL parameters are a great way to handle SPA navigation.
Not sure if I would use a plugin for this purpose… actually no, I would not use a plugin for this purpose. Why add a dependency when it can be avoided?
I’m old fashioned and like to keep things simple so they simply work.