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

Add a class field to hold the lifecycle state of the component and Update componentWillReceiveProps to componentDidUpdate #48

Closed
wants to merge 6 commits into from

Conversation

jhainaua
Copy link

Add _isMounted to handle async requests while CountDown is unmounted.

@jhainaua jhainaua changed the title Add a class field to hold the lifecycle state of the component Add a class field to hold the lifecycle state of the component and Update componentWillReceiveProps to componentDidUpdate Jul 16, 2019
Copy link

@kenmistry kenmistry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this componentDidUpdate change works! it gets rid of the deprecation warning with componentWillReceiveProps. i am running on react-native 0.60.4

@dsernst
Copy link

dsernst commented Jan 5, 2020

It's a little difficult to review this PR for its stated goals, because of all the whitespace changes.

Can those be separated out into a different PR?

@jhainaua
Copy link
Author

jhainaua commented Jan 6, 2020

I don't have time to address this today or Tuesday. I'll have time to post a revised PR by Wednesday or Thursday. In the meantime; for anyone else who might be having some trouble locating the changes please see my notes below. Thank you for your patience.

  1. Ctrl-f or Cmd-f for the _isMounted variable.
  2. Compare the lifecycle methods.

NEW CODE: componentDidMount, componentWillUnmount, componentDidUpdate.

vs.

EXISTING CODE: componentDidMount, componentWillUnmount, componentWillReceiveProps

@talalmajali
Copy link
Owner

@jhainaua what's the goal of tracking the lifecycle in the _isMounted variable?

@talalmajali
Copy link
Owner

@jhainaua @kenmistry @dsernst i've upgraded the component to use the component did mount, please upgrade to 2.7.1

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

Successfully merging this pull request may close these issues.

4 participants