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

Use browser routing (history API) instead of hash routing on #213

Closed
ShrimpCryptid opened this issue Apr 11, 2024 · 1 comment · Fixed by #226
Closed

Use browser routing (history API) instead of hash routing on #213

ShrimpCryptid opened this issue Apr 11, 2024 · 1 comment · Fixed by #226
Assignees

Comments

@ShrimpCryptid
Copy link
Contributor

ShrimpCryptid commented Apr 11, 2024

Use Case

Upcoming PR #212 sets all "production mode" builds to use hash router instead of browser router.

Solution

Configure S3 to correctly route to the base index.html, and then modify the logic in index.tsx so it uses createBrowserRouter instead of createHashRouter.

Alternatives

Please describe any alternatives you've considered, even if you've dismissed them

@ShrimpCryptid
Copy link
Contributor Author

See https://via.studio/journal/hosting-a-reactjs-app-with-routing-on-aws-s3 and the discussion on Simularium here: simularium/simularium-website#498. Will need infra support for this.

Similar approach that can be used on GitHub pages, capturing + redirecting 404 errors: https://github.com/rafgraph/spa-github-pages

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

Successfully merging a pull request may close this issue.

1 participant