From 9965642ebc888bf7dbe735200f3bb68fa370c3fa Mon Sep 17 00:00:00 2001 From: Felix Oghina Date: Thu, 11 Aug 2016 12:10:22 -0700 Subject: [PATCH] Fix docs generation Summary: Docs generator can't handle arrow functions as class members, resort to old-style function & bind in constructor. Reviewed By: bestander Differential Revision: D3703698 fbshipit-source-id: 894e2ba3686cbda437d186c913979b2f1170fe34 --- Libraries/Animated/src/AnimatedImplementation.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Libraries/Animated/src/AnimatedImplementation.js b/Libraries/Animated/src/AnimatedImplementation.js index bf307877d..8ad81d2de 100644 --- a/Libraries/Animated/src/AnimatedImplementation.js +++ b/Libraries/Animated/src/AnimatedImplementation.js @@ -1502,6 +1502,12 @@ function createAnimatedComponent(Component: any): any { class AnimatedComponent extends React.Component { _component: any; _propsAnimated: AnimatedProps; + _setComponentRef: Function; + + constructor(props: Object) { + super(props); + this._setComponentRef = this._setComponentRef.bind(this); + } componentWillUnmount() { this._propsAnimated && this._propsAnimated.__detach(); @@ -1578,7 +1584,7 @@ function createAnimatedComponent(Component: any): any { ); } - _setComponentRef = c => { + _setComponentRef(c) { this._component = c; } }