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

[Feature Request] React style component Lifecycle hooks #66

Closed
jewilhel opened this issue Jul 20, 2017 · 9 comments
Closed

[Feature Request] React style component Lifecycle hooks #66

jewilhel opened this issue Jul 20, 2017 · 9 comments

Comments

@jewilhel
Copy link

jewilhel commented Jul 20, 2017

I was reading through the React documentation and they talked about adding lifecycle hooks to a class: https://facebook.github.io/react/docs/state-and-lifecycle.html

with componentDidMount()
and componentWillUnmount()

These component methods would be very handy in addition to the willUpdate() and didUpdate() methods already available.

For example, I want to trigger animations when I create and present a component to the screen and also I want to trigger another just before the component is removed.

Thanks for your consideration! :)

@alexdrone
Copy link
Owner

On it :)

@jewilhel
Copy link
Author

Oh, wow! I'm excited for this. This will make deploying animation so much easier! Thanks you!

@alexdrone
Copy link
Owner

Fixed in 4.9

@alexdrone
Copy link
Owner

See the AbsoluteLayoutExample for an example of the api use.

@jewilhel
Copy link
Author

Man this is great. Had a look at the example code, looks easy enough. Can't wait to try it out. Thanks so much Alex this is so helpful! 👍

@jewilhel
Copy link
Author

Hi Alex,
I did some testing of the new method didMount() in my components after studying your example in the demo project and discovered that the method doesn't get called in child components that are nested in parent components. Apparently, the method only works if the component is the Root node of the ViewController. This doesn't seem helpful beyond the base node of my view hierarchy.

Thanks for taking a look at this! - Jason W.

@alexdrone
Copy link
Owner

alexdrone commented Jul 31, 2017 via email

@jewilhel
Copy link
Author

Thanks so much Alex! :)

@jewilhel
Copy link
Author

I'm also curious if the WillUnmount() method is too challenging at this time? :) I know you're super busy, I'm just interested in what you think about that one. If its practical or not. I've been trying to figure out how to implement similar functionality myself! Just haven't come up with good ideas.

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