talalmajali / react-native-countdown-component

React Native CountDown
MIT License
272 stars 236 forks source link

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

Closed jhainaua closed 4 years ago

jhainaua commented 5 years ago

Add _isMounted to handle async requests while CountDown is unmounted.

dsernst commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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

talalmajali commented 4 years ago

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