Skip to content

Commit

Permalink
Fix unrecognised forwardedRef prop error
Browse files Browse the repository at this point in the history
Have `withGlobalEvents` omit the `forwardedRef` prop. This prevents the
prop being added to HTML in some cases, e.g. when used in
`FocusableIframe`.
  • Loading branch information
noisysocks committed Aug 7, 2018
1 parent 831e328 commit 13dcbda
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/compose/src/with-global-events/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,12 @@ function withGlobalEvents( eventTypesToHandlers ) {
}

render() {
return <WrappedComponent { ...this.props } ref={ this.handleRef } />;
return <WrappedComponent { ...this.props.ownProps } ref={ this.handleRef } />;
}
}

return forwardRef( ( props, ref ) => {
return <Wrapper { ...props } forwardedRef={ ref } />;
return <Wrapper ownProps={ props } forwardedRef={ ref } />;
} );
}, 'withGlobalEvents' );
}
Expand Down

0 comments on commit 13dcbda

Please sign in to comment.