Animated: Lower onAnimatedValueUpdate to AnimatedValue#48514
Closed
yungsters wants to merge 2 commits into
Closed
Conversation
Contributor
|
This pull request was exported from Phabricator. Differential Revision: D67884973 |
Contributor
|
This pull request was exported from Phabricator. Differential Revision: D67884973 |
f1d023d to
5888c3d
Compare
Summary: While refactoring `Animated`, I noticed that many subclasses of `AnimatedNode` override `__attach` without invoking the superclass method, even though we do this for `__detach`. In order to minimize surprise (e.g. if someone were to add logic into `AnimatedNode.prototype.__attach`), this diff updates all method overrides to invoke `super.__attach()`. Changelog: [Internal] Differential Revision: D67884975
…48514) Summary: Pull Request resolved: facebook#48514 Currently, `AnimatedNode` implements logic to start listening to updates on the current native node if a listener is added. However, the `startListeningToAnimatedNodeValue` native module method only supports native tags for instances of `AnimatedValue`, which is a subclass of `AnimatedNode`. In fact… * On Android, [`startListeningToAnimatedNodeValue`](https://fburl.com/code/bdsl4sro) throws if the node is not an instance of `ValueAnimatedNode`. * On iOS, [`startListeningToAnimatedNodeValue`](https://fburl.com/code/hlpk1rzk) does nothing if node is not an instance of `RCTValueAnimatedNode`. As such, this refactors `AnimatedNode` to never manage this subscription for native nodes. Instead, the logic is moved into the `AnimatedValue` subclass, ensuring that we never accidentally try to `startListeningToAnimatedNodeValue` with non-`AnimatedValue` native tags. Changelog: [Internal] Reviewed By: javache Differential Revision: D67884973
Contributor
|
This pull request was exported from Phabricator. Differential Revision: D67884973 |
5888c3d to
014169b
Compare
Contributor
|
This pull request has been merged in 38c46fe. |
8 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary:
Currently,
AnimatedNodeimplements logic to start listening to updates on the current native node if a listener is added.However, the
startListeningToAnimatedNodeValuenative module method only supports native tags for instances ofAnimatedValue, which is a subclass ofAnimatedNode. In fact…startListeningToAnimatedNodeValuethrows if the node is not an instance ofValueAnimatedNode.startListeningToAnimatedNodeValuedoes nothing if node is not an instance ofRCTValueAnimatedNode.As such, this refactors
AnimatedNodeto never manage this subscription for native nodes. Instead, the logic is moved into theAnimatedValuesubclass, ensuring that we never accidentally try tostartListeningToAnimatedNodeValuewith non-AnimatedValuenative tags.Changelog:
[Internal]
Differential Revision: D67884973