-
Notifications
You must be signed in to change notification settings - Fork 347
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
willMount
for server side rendering
#95
Comments
Can you also list one concrete use-case please? Just for reference |
My use case is that I want to create component that updates the page title. The implementation in client side to call the side-effect inside But, |
Do put the code in the constructor is enough? |
Note that this wouldn't work with streaming, in reactjs, anyway |
Yes, but streaming is optional. No ? |
Finally it's planned to add willMount? |
Instead of imperatively updating the title once the component has been mounted, how about rendering the correct title from the beginning? This could possibly hint to somewhere where you could improve your design. Also, in ReactJS, none of the lifecycle-hooks are run on server rendering AFAIK. |
Precisely, the lifecycle-hook https://reactjs.org/docs/react-component.html#unsafe_componentwillmount |
I think SSR is fully supported with hooks. We aren’t planning on adding features to the record api. |
In React Server side rendering,
componentDidMount
is not triggered.On the other hand, ReasonReact doesn't have
willMount
but onlydidMount
.What can I do if I need
componentDidMount
in server side?The text was updated successfully, but these errors were encountered: