Use console.error() for the Touchable.js bug so we can capture it in production logs

Reviewed By: javache

Differential Revision: D2717874

fb-gh-sync-id: 7c2cac61fe4fbd2c6de6cf1d9059df9ac119f543
This commit is contained in:
Nick Lockwood 2015-12-03 07:43:34 -08:00 committed by facebook-github-bot-4
parent 87253ca722
commit 3313f769f5
1 changed files with 3 additions and 8 deletions

View File

@ -572,14 +572,9 @@ var TouchableMixin = {
var curState = this.state.touchable.touchState;
if (curState !== States.RESPONDER_ACTIVE_PRESS_IN &&
curState !== States.RESPONDER_ACTIVE_LONG_PRESS_IN) {
if (__DEV__) {
throw new Error(
'Attempted to transition from state `' + curState + '` to `' +
States.RESPONDER_ACTIVE_LONG_PRESS_IN + '`, which is not supported. ' +
'This is most likely due to `Touchable.longPressDelayTimeout` not ' +
'being cancelled.'
);
}
console.error('Attempted to transition from state `' + curState + '` to `' +
States.RESPONDER_ACTIVE_LONG_PRESS_IN + '`, which is not supported. This is ' +
'most likely due to `Touchable.longPressDelayTimeout` not being cancelled.');
} else {
this._receiveSignal(Signals.LONG_PRESS_DETECTED, e);
}