diff --git a/connectAnimation.js b/connectAnimation.js index cd20bf5..7e8290c 100644 --- a/connectAnimation.js +++ b/connectAnimation.js @@ -135,6 +135,7 @@ export function connectAnimation(WrappedComponent, animations = {}) { super(props, context); this.onLayout = this.onLayout.bind(this); this.resolveStyle = this.resolveStyle.bind(this); + this.setWrappedInstance = this.setWrappedInstance.bind(this); this.state = { layout: { height: 0, @@ -174,6 +175,16 @@ export function connectAnimation(WrappedComponent, animations = {}) { }); } + setNativeProps(nativeProps) { + if (this.wrappedInstance.setNativeProps) { + this.wrappedInstance.setNativeProps(nativeProps); + } + } + + setWrappedInstance(component) { + this.wrappedInstance = component; + } + render() { const { resolvedStyle } = this.state; const ConnectedComponent = isComponentAnimated(this.props) ? @@ -185,6 +196,7 @@ export function connectAnimation(WrappedComponent, animations = {}) { onLayout={this.onLayout} {...this.props} style={resolvedStyle} + ref={this.setWrappedInstance} /> ); }