-
-
Notifications
You must be signed in to change notification settings - Fork 156
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 wouter in SSR mode and detect redirects #468
Comments
It's not possible at the moment unfortunately. The |
@molefrog the approach taken by react-router and other libraries (such as loadable-components) that need to track render attributes of a child during a SSR is to wrap their children in a context. The child component (in this case Look at usages of Another example, look at how Perhaps |
Thank you @gbettencourt for your post. If i understand you correctly there is no need for the library to be updated and in a way I could do this by implementing my own Context? If so could you be so kind to provide me with an example based on my code above. It would help tremendously. |
You could implement this without library support. I did open a PR to add support directly in wouter here: #491. That should give you an idea of how to implement outside the library. Basically you'd need to wrap your components in a custom context, then implement and use your own |
Hi community,
my question is pretty straight forward. How do I migrate from the old static-location to the new SSR mode way of working when I need to detect redirects. I think I understand the migration but im just missing the 'record: true' part and where i can make it fit into the context.
Example: I used the old functionality in this way:
const location = staticLocationHook(req.originalUrl, { record: true });
And then i use it like
and also
Thank you in advanced
The text was updated successfully, but these errors were encountered: