software-mansion / react-native-gesture-handler

Declarative API exposing platform native touch and gesture system to React Native.
https://docs.swmansion.com/react-native-gesture-handler/
MIT License
6.14k stars 982 forks source link

[macOS] Add `ForceTouch` warning #2954

Closed m-bert closed 5 months ago

m-bert commented 5 months ago

Description

This PR adds warning that ForceTouchGestureHandler is not implemented on macOS. As stated in #2701:

(...) This leads to some inconvenience, as we still have JS warning about not supporting Force Touch. It should be moved to native files as well.

This is not true. Warning mentioned in quote above says that ForceTouch is not available on given platform. However, this is generic warning that will be thrown also for example on Android or web (if given platform doesn't support ForceTouch). This is something different from not supporting ForceTouchGestureHandler and it should not be removed.

The other thing is that warning about ForceTouch availability is currently missing on new API. We will add it soon.

Closes #2701

Test plan

Place the following code inside any example in MacOSExample:

Test code ```tsx import React from 'react'; import { StyleSheet, View } from 'react-native'; import { Gesture, GestureDetector } from 'react-native-gesture-handler'; export default function App() { const ft = Gesture.ForceTouch(); return ( ); } const styles = StyleSheet.create({ container: { width: 100, height: 100, backgroundColor: 'crimson', }, }); ```