Browser History vs Hash-Based Routing
Developers should learn and use Browser History when building modern web applications, especially single-page applications (SPAs) with frameworks like React, Angular, or Vue meets developers should use hash-based routing when building spas that need to support deep linking and browser history without server-side configuration, as it relies solely on client-side javascript and doesn't require server support for routing. Here's our take.
Browser History
Developers should learn and use Browser History when building modern web applications, especially single-page applications (SPAs) with frameworks like React, Angular, or Vue
Browser History
Nice PickDevelopers should learn and use Browser History when building modern web applications, especially single-page applications (SPAs) with frameworks like React, Angular, or Vue
Pros
- +js, to provide intuitive navigation and maintain application state
- +Related to: javascript, single-page-applications
Cons
- -Specific tradeoffs depend on your use case
Hash-Based Routing
Developers should use hash-based routing when building SPAs that need to support deep linking and browser history without server-side configuration, as it relies solely on client-side JavaScript and doesn't require server support for routing
Pros
- +It's ideal for applications hosted on static file servers or CDNs where server-side routing isn't feasible, such as in GitHub Pages or simple web apps
- +Related to: single-page-applications, javascript-routing
Cons
- -Specific tradeoffs depend on your use case
The Verdict
Use Browser History if: You want js, to provide intuitive navigation and maintain application state and can live with specific tradeoffs depend on your use case.
Use Hash-Based Routing if: You prioritize it's ideal for applications hosted on static file servers or cdns where server-side routing isn't feasible, such as in github pages or simple web apps over what Browser History offers.
Developers should learn and use Browser History when building modern web applications, especially single-page applications (SPAs) with frameworks like React, Angular, or Vue
Disagree with our pick? nice@nicepick.dev