Skip to content

Commit

Permalink
Fix regression on Pressable ref (#39405)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: #39405

Fix regression on Pressable ref introduced in D49056493.

Changelog: [Internal]

Reviewed By: javache, yungsters

Differential Revision: D49166057

fbshipit-source-id: c16526c195e8478fba1bf0a125d0981314e47f9d
  • Loading branch information
fabriziocucci authored and facebook-github-bot committed Sep 12, 2023
1 parent 247717b commit 15a2980
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ function Pressable(props: Props, forwardedRef): React.Node {
} = props;

const viewRef = useRef<React.ElementRef<typeof View> | null>(null);
useMergeRefs(forwardedRef, viewRef);
const mergedRef = useMergeRefs(forwardedRef, viewRef);

const android_rippleConfig = useAndroidRippleForView(android_ripple, viewRef);

Expand Down Expand Up @@ -339,7 +339,7 @@ function Pressable(props: Props, forwardedRef): React.Node {
<View
{...restPropsWithDefaults}
{...eventHandlers}
ref={viewRef}
ref={mergedRef}
style={typeof style === 'function' ? style({pressed}) : style}
collapsable={false}>
{typeof children === 'function' ? children({pressed}) : children}
Expand Down

0 comments on commit 15a2980

Please sign in to comment.