Closed olessavluk closed 8 years ago
I am quite inexperienced with universal applications so thank you for raising potential issues.
I cloned and ran your example, the error goes away by removing the input element in Timer
component. Not sure what that means.
I have created new branch (logall
) and put logs everywhere to see what is actually going on.
As you can see, listener executes setState
after rendering is complete and this actually causes an error.
:tada: I think I managed to fix it. The problem is not with componentWillUnmount
but with suff in component constructor (componentWillMount
) which should be in componentDidMount
.
I will commit a fix and release it later tonight.
You are talking about this ?) - https://github.com/olessavluk/react-router5/commit/12aad1612002f7d5380c60370e9dbeaffa55376e
Yes, exactly. I also moved the check for the listeners plugin to component did mount so you are not forced to use it on the server side.
1.0.1 has been published
Thank you very much for raising that bug and taking the time to create a repo. I really appreciate. :+1:
Linking it to other similar issues, in case that helps others.
RickWong/react-isomorphic-starterkit#77 denvned/isomorphic-relay-router#5
I am getting error when trying to render on the server:
(Here I created repo to reproduce this issue: https://github.com/olessavluk/r5bug ) I'm using node v5.0.0 & npm v3.4.1. And I have only one veriosn of React installed, because
find ./ -name 'react'
returns only one result.//node_modules/react
.So I think problem in this file https://github.com/router5/react-router5/blob/master/modules/routeNode.js#L21. Because you are adding listener in constructor and removing it in
componentWillUnmout
, but unmount never gets executed on the server.