You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
tl:dr;
in order for nested component to render properly the component instance needs to recalculate props after the "visitor" function is run and before render is called.
what i understand from what happens:
case: we have two components that want to lazy load data from server, one sibling of the other
(i call them first and second), both of them are decorated with redux connect
running steps:
reactWalkTree gets the App and walks it
runs the connector component, binds the store props to the component props,
then runs by "bootstrap" function,
waits for it to finish and then runs the render,
the issue is that the render function is called with the props that were bind to the component before the "bootstrap" function was called. and having a if(!ready) return (<div>Loading</div>); will never give a change to the secondComponent.bootstrap to run and gather the data. thus not not getting the correct ssr,
hope this is clear enough,
The text was updated successfully, but these errors were encountered:
here is a repo to reproduce the issue but i will try to summarise it here
https://github.com/CosticaPuntaru/react-walk-tree--redux-bug
tl:dr;
in order for nested component to render properly the component instance needs to recalculate props after the "visitor" function is run and before render is called.
what i understand from what happens:
case: we have two components that want to lazy load data from server, one sibling of the other
(i call them first and second), both of them are decorated with redux connect
running steps:
reactWalkTree gets the App and walks it
runs the connector component, binds the store props to the component props,
then runs by "bootstrap" function,
waits for it to finish and then runs the render,
the issue is that the render function is called with the props that were bind to the component before the "bootstrap" function was called. and having a
if(!ready) return (<div>Loading</div>);
will never give a change to the secondComponent.bootstrap to run and gather the data. thus not not getting the correct ssr,hope this is clear enough,
The text was updated successfully, but these errors were encountered: