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

Rive component wrapped with Pressable not pressable #288

Open
vivianedias opened this issue Feb 5, 2025 · 1 comment
Open

Rive component wrapped with Pressable not pressable #288

vivianedias opened this issue Feb 5, 2025 · 1 comment

Comments

@vivianedias
Copy link

vivianedias commented Feb 5, 2025

Description

I'm currently using rive-react-native on my React Native project, and the lib is working correctly. But recently when I tried wrapping the Rive component with a Pressable comp to enable call another func, it simply won't call the function.

Provide a Repro

<Pressable onPress={onPress} style={styles.button}>
  <Rive
      ref={riveRef}
      url={RIVE_ASSET_URL}
      fit={Fit.Fill}
      artboardName={currentAnimal.riveArtboardName}
      stateMachineName={ANIMAL_SELECTION_BUTTON_STATE_MACHINE}
      onStateChanged={(stateMachineName, stateName) => {
        console.log(
          "onStateChanged AnimalSelectionButton: ",
          "stateMachineName: ",
          stateMachineName,
          "stateName: ",
          stateName
        );
      }}
      onError={(riveError: RNRiveError) => {
        console.log({ riveError });
      }}
    />
</Pressable>

Expected behavior

The onPress behaviour form the Pressable component wrapping Rive should still work.

Device & Versions (please complete the following information)

  • Device: Android Emulator
  • OS: Android 14.0, Android SDK Build Tools 36
  • Yarn Version: 1.22.22
@tiago138
Copy link

tiago138 commented Feb 7, 2025

I just wrap a View on the Rive component and set the pointerEvents to none.

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