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

feat: support server redirects #491

Open
wants to merge 1 commit into
base: v3
Choose a base branch
from

Conversation

gbettencourt
Copy link

@gbettencourt gbettencourt commented Oct 23, 2024

Add the ability to redirect during SSR. Currently wouter only supports redirect once the app hydrates and the components render client side. Being able to redirect from the server is more efficient (only requires sending a status code/path back), resulting in a better user experience. The response can also be cached by the browser.

Resolves #468

Copy link

stackblitz bot commented Oct 23, 2024

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

Copy link

codecov bot commented Oct 23, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (48b63a9) to head (0f529cb).

Additional details and impacted files
@@            Coverage Diff            @@
##                v3      #491   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            1         1           
  Lines            1         1           
=========================================
  Hits             1         1           
Flag Coverage Δ
?

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@radfahrer
Copy link

@molefrog, we would greatly appreciate it if you could review this PR. We would very much like to migrate our application from react-router to wouter and this piece of missing functionality is holding us up.

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 this pull request may close these issues.

Use wouter in SSR mode and detect redirects
2 participants