You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
## Description
When building app with `react-native` 0.78.1, _**Gesture Handler**_ build fails with the following error message:
```
react-native-gesture-handler/android/fabric/src/main/java/com/swmansion/gesturehandler/ReactContextExtensions.kt:10:
Error: Must be one of: UIManagerType.DEFAULT, UIManagerType.FABRIC [WrongConstant]
val fabricUIManager = UIManagerHelper.getUIManager(this, UIManagerType.FABRIC) as FabricUIManager
```
As stated in the error above, constant passed to `getUIManager` should be either `UIManagerType.DEFAULT` or `UIManagerType.FABRIC`, but this condition is clearly met. In that case, I've added `SuppressLint` annotation to get rid of the error.
Fixes#3464
## Test plan
Function above is called in specific condition, i.e. if `onGestureEvent` is `Animated.Event`. In order to check if we can suppress this error without problems, I've used the following code:
<details>
<summary>Test code</summary>
```jsx
import React, {useRef} from 'react';
import {View, Animated, StyleSheet} from 'react-native';
import {
PanGestureHandler,
GestureHandlerRootView,
State,
} from 'react-native-gesture-handler';
export default function App() {
const translateX = useRef(new Animated.Value(0)).current;
const translateY = useRef(new Animated.Value(0)).current;
const onGestureEvent = Animated.event(
[{nativeEvent: {translationX: translateX, translationY: translateY}}],
{useNativeDriver: true},
);
const onHandlerStateChange = event => {
if (event.nativeEvent.state === State.END) {
Animated.spring(translateX, {
toValue: 0,
useNativeDriver: true,
}).start();
Animated.spring(translateY, {
toValue: 0,
useNativeDriver: true,
}).start();
}
};
return (
<GestureHandlerRootView style={styles.container}>
<PanGestureHandler
onGestureEvent={onGestureEvent}
onHandlerStateChange={onHandlerStateChange}>
<Animated.View
style={[
styles.box,
{
transform: [{translateX}, {translateY}],
},
]}
/>
</PanGestureHandler>
</GestureHandlerRootView>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
},
box: {
width: 100,
height: 100,
backgroundColor: 'tomato',
borderRadius: 10,
},
});
```
</details>
and added a breakpoint to check whether we get correct `UIManager` instance:

0 commit comments