Skip to content

Commit

Permalink
fix warnings in create view
Browse files Browse the repository at this point in the history
Reviewed By: fred2028

Differential Revision: D5016368

fbshipit-source-id: 60fae5769f66bf94de6fa2fe75a509862270c401
  • Loading branch information
zjj010104 authored and facebook-github-bot committed May 8, 2017
1 parent 8e6bde3 commit bd00456
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions Libraries/Components/Touchable/TouchableHighlight.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@

var ColorPropType = require('ColorPropType');
var NativeMethodsMixin = require('NativeMethodsMixin');
var React = require('React');
const PropTypes = require('prop-types');
var React = require('React');
var ReactNativeViewAttributes = require('ReactNativeViewAttributes');
var StyleSheet = require('StyleSheet');
var TimerMixin = require('react-timer-mixin');
Expand Down Expand Up @@ -137,16 +137,22 @@ var TouchableHighlight = React.createClass({
},

getInitialState: function() {
this._isMounted = false;
return merge(
this.touchableGetInitialState(), this._computeSyntheticState(this.props)
);
},

componentDidMount: function() {
this._isMounted = true;
ensurePositiveDelayProps(this.props);
ensureComponentIsNative(this.refs[CHILD_REF]);
},

componentWillMount: function() {
this._isMounted = false;
},

componentDidUpdate: function() {
ensureComponentIsNative(this.refs[CHILD_REF]);
},
Expand Down Expand Up @@ -216,7 +222,7 @@ var TouchableHighlight = React.createClass({
},

_showUnderlay: function() {
if (!this.isMounted() || !this._hasPressHandler()) {
if (!this._isMounted || !this._hasPressHandler()) {
return;
}

Expand Down

0 comments on commit bd00456

Please sign in to comment.