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

Support full component lifecycle in shallow rendering #4919

Closed
glenjamin opened this issue Sep 20, 2015 · 1 comment
Closed

Support full component lifecycle in shallow rendering #4919

glenjamin opened this issue Sep 20, 2015 · 1 comment

Comments

@glenjamin
Copy link
Contributor

Extracted as a separate issue from #4056 (comment)

I've put together a side-by-side comparison of lifecycle support between "normal" rendering and "shallow" rendering.

http://jsfiddle.net/xvs6xdfk/3/

Output using normal rendering

Rendering Comp with Object {key: 1, a: 1}
componentWillMount []
render []
componentDidMount []
Rendering Comp with Object {key: 1, a: 2}
componentWillReceiveProps [Object, Object]
shouldComponentUpdate [Object, null, Object]
componentWillUpdate [Object, null, Object]
render []
componentDidUpdate [Object, null, Object]
Rendering Comp with Object {key: 2}
componentWillUnmount []
componentWillMount []
render []
componentDidMount []

Output using shallow rendering

Rendering Comp with Object {key: 1, a: 1}
componentWillMount []
render []
Rendering Comp with Object {key: 1, a: 2}
componentWillReceiveProps [Object, Object]
shouldComponentUpdate [Object, null, Object]
componentWillUpdate [Object, null, Object]
render []
Rendering Comp with Object {key: 2}
componentWillReceiveProps [Object, Object]
shouldComponentUpdate [Object, null, Object]
componentWillUpdate [Object, null, Object]
render []

Happy to look into doing a PR for this, although I'm not sure quite where to start - would this be done in the shallow renderer itself, or pushed down to a custom transaction as mentioned in #4019 (comment) ?

@gaearon
Copy link
Collaborator

gaearon commented Oct 6, 2015

Somewhat related: #3760

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

No branches or pull requests

2 participants