Skip to content

Attempted to transition from state RESPONDER_INACTIVE_PRESS_IN to RESPONDER_ACTIVE_LONG_PRESS_IN, which is not supported. #11989

Closed
@magrinj

Description

@magrinj

Same as #5823 that has been closed, when I'm in debugging mode with react-native@0.36.1 I got sometimes this error randomly:

console.error: "Attempted to transition from state `RESPONDER_INACTIVE_PRESS_IN` to `RESPONDER_ACTIVE_LONG_PRESS_IN`, which is not supported. This is most likely due to `Touchable.longPressDelayTimeout` not being cancelled."
Object.console.error
    YellowBox.js:61
Constructor._handleLongDelay
    Touchable.js:595
Constructor.proxiedMethod [as _handleLongDelay]
    createPrototypeProxy.js:44
<unknown>
    JSTimers.js:78
Object.callTimer
    JSTimersExecution.js:99
Object.callTimers
    JSTimersExecution.js:140
MessageQueue.__callFunction
    MessageQueue.js:236
<unknown>
    MessageQueue.js:108
guard
    MessageQueue.js:46
MessageQueue.callFunctionReturnFlushedQueue
    MessageQueue.js:107
message
    RNDebuggerWorker.js:123:57

Apparently, thanks to #5823 the code can be reproduced like that:

class App extends Component {
  constructor() {
    super()
    this.state = {
      testText: ''+Math.random()
    }
  }

  _updateTouch(e) {
    this.setState({testText: ''+Math.random()})
  }

  render() {
    return (
      <View style={styles.container}>
        <Text>
          {this.state.testText}
        </Text>
        <TouchableHighlight onPress={this._updateTouch.bind(this)}>
          <Image
            style={width: 100, height: 100}
            source={{uri: 'http://facebook.github.io/react/img/logo_og.png'}}
          />
        </TouchableHighlight>
      </View>
    );
  }
}

I see a lot of people having the same issue on the old ticket, so I choose to open a new one because the old one is actually closed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Ran CommandsOne of our bots successfully processed a command.Resolution: LockedThis issue was locked by the bot.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions