Fix weird `createAnimatedComponent` babel/flow bug
Summary: There are some versions of babel 7's flow support that cause problems with property initializers. I changed this code to use class properties to fix the issue. See https://github.com/facebook/react-native/issues/20588 Reviewed By: TheSavior Differential Revision: D13396959 fbshipit-source-id: a76266ac0c8a6a19a1c45f7136de4aba9c72581d
This commit is contained in:
parent
b0c43717a6
commit
78132a0ab8
|
@ -30,13 +30,11 @@ function createAnimatedComponent(Component: any): any {
|
|||
_prevComponent: any;
|
||||
_propsAnimated: AnimatedProps;
|
||||
_eventDetachers: Array<Function> = [];
|
||||
_setComponentRef: Function;
|
||||
|
||||
static __skipSetNativeProps_FOR_TESTS_ONLY = false;
|
||||
|
||||
constructor(props: Object) {
|
||||
super(props);
|
||||
this._setComponentRef = this._setComponentRef.bind(this);
|
||||
}
|
||||
|
||||
componentWillUnmount() {
|
||||
|
@ -164,10 +162,10 @@ function createAnimatedComponent(Component: any): any {
|
|||
);
|
||||
}
|
||||
|
||||
_setComponentRef(c) {
|
||||
_setComponentRef = c => {
|
||||
this._prevComponent = this._component;
|
||||
this._component = c;
|
||||
}
|
||||
};
|
||||
|
||||
// A third party library can use getNode()
|
||||
// to get the node reference of the decorated component
|
||||
|
|
Loading…
Reference in New Issue