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

react-dom: "^16.4.0" (&& "16.4.2") PanResponder bug #13504

Closed
English3000 opened this issue Aug 29, 2018 · 2 comments
Closed

react-dom: "^16.4.0" (&& "16.4.2") PanResponder bug #13504

English3000 opened this issue Aug 29, 2018 · 2 comments

Comments

@English3000
Copy link

Steps to reproduce:

create-react-native-app test --with-web-support (defaults to [email protected])
cd test && npm install

Copy into App.js:

import React from "react"
import { Animated, PanResponder } from "react-native"

export default class App extends React.Component {
  constructor(){
    super()
    this.state = { pan: new Animated.ValueXY() }
    this.panResponder = {}
  }

  render() {
    return (
      <Animated.View {...this.panResponder.panHandlers}
        style={{transform: this.state.pan.getTranslateTransform(), borderWidth: "1"}}>
        <Animated.Text>Open up src/App.js to start working on your app!</Animated.Text>
        <Animated.Text>Changes you make will automatically reload.</Animated.Text>
        <Animated.Text>Shake your phone to open the developer menu.</Animated.Text>
      </Animated.View>
    )
  }

  componentDidMount(){
    this.panResponder = PanResponder.create({
      onStartShouldSetPanResponder: () => true,
      onPanResponderMove: Animated.event([ null, { dx: this.state.pan.x,
                                                   dy: this.state.pan.y } ])
    })
    this.forceUpdate()
  }
}

yarn web

You have a draggable (albeit slightly buggy) textbox!

npm i -S [email protected]

yarn web

It doesn't move!

npm i -S [email protected]

It still doesn't move!

npm i -S [email protected]

And behold, it moves!

@gaearon
Copy link
Collaborator

gaearon commented Aug 29, 2018

My guess is you're using a version of react-native-web before this change: necolas/react-native-web#908 (comment). Try with 0.7.3 or later.

@gaearon gaearon closed this as completed Aug 29, 2018
@English3000
Copy link
Author

Confirmed.

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

2 participants