Skip to content

Conversation

@janicduplessis
Copy link
Contributor

To silence the react warning, ideally we'd migrate to new React apis.

To silence the react warning, ideally we'd migrate to new React apis.
@osdnk
Copy link
Contributor

osdnk commented Jun 22, 2019

Thank you, @janicduplessis!
Can't we use compenentDidUpdate? 😃

@janicduplessis
Copy link
Contributor Author

janicduplessis commented Jun 22, 2019

@osdnk Sadly no since _updateAnimatedEvent sets a bunch of instance vars that are used in the subsequent render. If moved to compenentDidUpdate the wrong values would be used.

A cool way to fix it would be to use hooks. Otherwise we'd need getDerivedStateFromProps but that would be a lot more involved since we'd need to save prev props in state to diff.

Copy link
Contributor

@osdnk osdnk left a comment

Choose a reason for hiding this comment

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

Thanks!

@osdnk osdnk merged commit f7acdd0 into software-mansion:master Jul 7, 2019
jordmccord pushed a commit to jordmccord/react-native-gesture-handler that referenced this pull request Sep 18, 2019
To silence the react warning, ideally we'd migrate to new React apis.

(cherry picked from commit f7acdd0)
janicduplessis added a commit to janicduplessis/react-native-gesture-handler that referenced this pull request Feb 16, 2020
To silence the react warning, ideally we'd migrate to new React apis.
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.

2 participants