microsoft / react-native-windows

A framework for building native Windows apps with React.
https://microsoft.github.io/react-native-windows/
Other
16.36k stars 1.14k forks source link

PanResponder / Responder don't appear to work on New Architecture #14119

Open austinhallock opened 6 days ago

austinhallock commented 6 days ago

Problem Description

Hey folks! Have been playing around with 0.76.0 and loving it so far. One thing that doesn't seem to work, which I haven't found an existing GitHub issue for is PanResponder. I'm trying out the basic example from https://reactnative.dev/docs/panresponder and it doesn't move.

If I tweak the responder a bit to:

  const panResponder = useRef(
    PanResponder.create({
      onStartShouldSetPanResponder: () => true,
      onMoveShouldSetPanResponder: () => true,
      onPanResponderGrant: () => {
        console.log('onPanResponderGrant');
      },
      onPanResponderMove: (event, gesture) => {
        console.log(gesture);
      },
      onPanResponderRelease: () => {
        console.log('onPanResponderRelease');
        pan.extractOffset();
      },
    }),
  ).current;

It'll log the onPanResponderGrant (unless the view has a as a child) and onPanResponderRelease, but it never triggers onPanResponderMove

The same can be said for Gesture Responder and onResponderMove (which seems like it should work).

onPointerMove does work, so we can probably use that in the interim :)

Steps To Reproduce

Fresh install of new architecture -> copy and paste example from https://reactnative.dev/docs/panresponder

Expected Results

No response

CLI version

15.0.0

Environment

Windows 11 10.0.22631
React Native 0.76.1
RNW 0.76.0

Community Modules

No response

Target Platform Version

None

Target Device(s)

No response

Visual Studio Version

None

Build Configuration

None

Snack, code example, screenshot, or link to a repository

No response

chrisglein commented 19 hours ago

So glad you're trying out 0.76. Thanks for the feedback! Our best guess here is that the touch events are not quite hooked up right. We'll investigate.