Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade React 0.14.x -> 15.0.1 break onPress event #123

Closed
grigio opened this issue Apr 11, 2016 · 3 comments
Closed

Upgrade React 0.14.x -> 15.0.1 break onPress event #123

grigio opened this issue Apr 11, 2016 · 3 comments

Comments

@grigio
Copy link

grigio commented Apr 11, 2016

Here is a snippet of code, it still works on

...
<Text key={i}  onPress={...}>Test</Text>

but it is broken on:

        <TouchableHighlight onPress={this.onPressInfo}>
          <View >
            <Text style={styles.fontUI}>
            ★ info
            </Text>
          </View>
        </TouchableHighlight>

I get:

Touchable.js:560 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.

As workaround I downgraded React to 0.14.8

@necolas
Copy link
Owner

necolas commented Apr 11, 2016

I'll have to look into whether this is a problem in React Native's Touchable (i.e., upstream) or the Responder event plugin. FYI, this project still has a peerDependency on React 0.14.

@gsklee
Copy link

gsklee commented Apr 25, 2016

@necolas Just curious, what are the changes within React v15 that makes it incompatible with react-native-web?

@MoOx
Copy link
Contributor

MoOx commented May 4, 2016

I am getting the issue with React 0.14 (I just downgraded too, but bug is still here) and this code

  return (
    <TouchableHighlight
      style={ [
        props.style,
        styles.link,
      ] }
      onPress={ () => {
        console.log("onpress")
        link(props.to)()
        console.log("onpress done mofo")
      } }
    >
      <Text
        onPress={ () => {
          console.log("text onpress")
        } }
      >
        { props.children }
      </Text>
    </TouchableHighlight>
  )

If I replace TouchableHighlight by a Text component, both onPress works. It seems like it's an issue with TouchableHighlight and not just React 15 :/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants