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

Expose getNode() on component created with createAnimatedComponent #9944

Closed
wants to merge 1 commit into from

Conversation

gre
Copy link
Contributor

@gre gre commented Sep 16, 2016

see also: eb3360b#commitcomment-19042340

commit eb3360b recently break some third libraries that was (weakly) relying on traversing animatedNode.refs.node to get the original node of the decorated (animated) component (at least 2 libs: gl-react-native and react-native-material-kit).
Instead of now doing animatedNode._component (that might later break again), getNode() is a more 'public' solution for these third party.

as you expose a way to create an animated component (createAnimatedComponent) you sometimes still want a way to get the reference.
That way, third party components can continue providing some extra native methods to the animated version.

commit eb3360b
recently break some third libraries that was (weakly) relying on traversing
animatedNode.refs.node to get the original node of the decorated component.
Instead of now doing animatedNode._component (that might later break again),
getNode() is a more 'public' solution for these third party.

as you expose a way to create an animated component (createAnimatedComponent)
you sometimes still want a way to get the reference.
That way, third party component can continue providing some extra native methods to the animated version.
gre referenced this pull request Sep 16, 2016
Summary: It was bothering me.

Reviewed By: davidaurelio

Differential Revision: D3690646

fbshipit-source-id: 50551f0bc4e879c36a262e923649745377ff0e2f
@ghost ghost added GH Review: review-needed CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. labels Sep 16, 2016
@satya164
Copy link
Contributor

cc @foghina

@ghost ghost added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Sep 16, 2016
@foghina
Copy link
Contributor

foghina commented Sep 19, 2016

@facebook-github-bot shipit

@ghost ghost added GH Review: accepted Import Started This pull request has been imported. This does not imply the PR has been approved. and removed GH Review: review-needed labels Sep 19, 2016
@ghost
Copy link

ghost commented Sep 19, 2016

Thanks for importing. If you are an FB employee go to Phabricator to review internal test results.

@ghost ghost added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Sep 19, 2016
@ghost ghost closed this in 19d0429 Sep 19, 2016
@slorber
Copy link
Contributor

slorber commented Jun 11, 2018

hey @gre , just wondering, could it make sense to use the new forwardRef instead of using getNode as the default? and let users get the animated ref with a different prop?

@gre
Copy link
Contributor Author

gre commented Jun 11, 2018

@slorber definitely!

@slorber
Copy link
Contributor

slorber commented Jun 11, 2018

great, just created a separate issue: #19650

This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Import Started This pull request has been imported. This does not imply the PR has been approved.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants