Skip to content

Commit b914153

Browse files
yungstersfacebook-github-bot
authored andcommitted
Animated: Delete getNode() on Refs
Summary: In 0.62, `createAnimatedComponent` was changed to use `forwardRef` instead of requiring callers to use `ref.getNode()`. In order to preserve backward-compatibility, `ref.getNode()` was monkey-patched onto the returned ref, if possible, to return the `ref` and output a console warning. Three major (well, technically, minor) releases later, we are dropping support for `getNode()`. Calling it on the `ref` of an animated component will begin to fail after this (unless the underlying component itself actually implements a `getNode()` method on its imperative handle). Changelog: [General][Removed] - Removed `getNode()` from animated component refs. Reviewed By: nadiia Differential Revision: D27979882 fbshipit-source-id: 885c3dbf4f2749c994fc2662dd6f16ff3dd887c7
1 parent 1b59263 commit b914153

File tree

1 file changed

+0
-13
lines changed

1 file changed

+0
-13
lines changed

Libraries/Animated/createAnimatedComponent.js

-13
Original file line numberDiff line numberDiff line change
@@ -198,19 +198,6 @@ function createAnimatedComponent<Props: {+[string]: mixed, ...}, Instance>(
198198
setLocalRef: ref => {
199199
this._prevComponent = this._component;
200200
this._component = ref;
201-
202-
// TODO: Delete this in a future release.
203-
if (ref != null && ref.getNode == null) {
204-
ref.getNode = () => {
205-
console.warn(
206-
'%s: Calling `getNode()` on the ref of an Animated component ' +
207-
'is no longer necessary. You can now directly use the ref ' +
208-
'instead. This method will be removed in a future release.',
209-
ref.constructor.name ?? '<<anonymous>>',
210-
);
211-
return ref;
212-
};
213-
}
214201
},
215202
});
216203

0 commit comments

Comments
 (0)