Skip to content

Commit

Permalink
Forward references components being wrapped
Browse files Browse the repository at this point in the history
  • Loading branch information
anddriex committed Jan 9, 2025
1 parent edca06d commit b96c043
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import React, {
useEffect,
useRef,
} from "react";
import { isForwardRef } from "react-is";
import { LayoutChangeEvent, StyleProp, View } from "react-native";

import { SpotlightTourContext } from "../../SpotlightTour.context";
Expand Down Expand Up @@ -88,7 +89,7 @@ export function AttachStep<T>({ children, fill = false, index }: AttachStepProps
updateSpot();
}, [updateSpot]);

if (typeof children.type === "function") {
if (typeof children.type === "function" || isForwardRef(children)) {
const { style, ...rest } = children.props;
const childStyle = style ?? { };

Expand Down

0 comments on commit b96c043

Please sign in to comment.