Skip to content

Commit

Permalink
Merge pull request #52 from wordpress-mobile/try/improve-onenter-call…
Browse files Browse the repository at this point in the history
…back

Adds a wrapper method for the onEnter callback.
  • Loading branch information
diegoreymendez authored Sep 10, 2018
2 parents b8cec63 + b28f40c commit be08be7
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/AztecView.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,22 @@ class AztecView extends React.Component {
onContentSizeChange(size);
}

_onEnter = (event) => {
if (!this.props.onEnter) {
return;
}

const { onEnter } = this.props;
onEnter();
}

render() {
const { onActiveFormatsChange, ...otherProps } = this.props
return (
<RCTAztecView {...otherProps}
onActiveFormatsChange={ this._onActiveFormatsChange }
onContentSizeChange = { this._onContentSizeChange }
onEnter = { this._onEnter }
/>
);
}
Expand Down

0 comments on commit be08be7

Please sign in to comment.