|
1 | 1 | import type {ForwardedRef} from 'react'; |
2 | | -import React, {forwardRef, useEffect, useRef} from 'react'; |
| 2 | +import React, {useEffect, useRef} from 'react'; |
3 | 3 | // eslint-disable-next-line no-restricted-imports |
4 | 4 | import type {GestureResponderEvent, Role, Text, View} from 'react-native'; |
5 | 5 | import Animated, {Easing, interpolateColor, useAnimatedStyle, useSharedValue, withTiming} from 'react-native-reanimated'; |
@@ -42,9 +42,12 @@ type FloatingActionButtonProps = { |
42 | 42 |
|
43 | 43 | /* If the tooltip is allowed to be shown */ |
44 | 44 | isTooltipAllowed: boolean; |
| 45 | + |
| 46 | + /** Reference to the outer element */ |
| 47 | + ref?: ForwardedRef<HTMLDivElement | View | Text>; |
45 | 48 | }; |
46 | 49 |
|
47 | | -function FloatingActionButton({onPress, onLongPress, isActive, accessibilityLabel, role, isTooltipAllowed}: FloatingActionButtonProps, ref: ForwardedRef<HTMLDivElement | View | Text>) { |
| 50 | +function FloatingActionButton({onPress, onLongPress, isActive, accessibilityLabel, role, isTooltipAllowed, ref}: FloatingActionButtonProps) { |
48 | 51 | const {success, buttonDefaultBG, textLight} = useTheme(); |
49 | 52 | const styles = useThemeStyles(); |
50 | 53 | const borderRadius = styles.floatingActionButton.borderRadius; |
@@ -157,4 +160,4 @@ function FloatingActionButton({onPress, onLongPress, isActive, accessibilityLabe |
157 | 160 |
|
158 | 161 | FloatingActionButton.displayName = 'FloatingActionButton'; |
159 | 162 |
|
160 | | -export default forwardRef(FloatingActionButton); |
| 163 | +export default FloatingActionButton; |
0 commit comments