<!-- Thanks for submitting a pull request! Please provide enough information so that others can review your pull request. The two fields below are mandatory. --> ## Summary Fix the invalid forward ref type when using `native`, `typescript` and `ref` options ```tsx import Svg, { Path } from 'react-native-svg' import type { SvgProps } from 'react-native-svg' import { Ref, forwardRef } from 'react' const Icon = (props: SvgProps, ref: Ref<SVGSVGElement>) => ( <Svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" // ↓ TS complains about a mismatch between SVGSVGElement and Svg from `react-native-svg` ref={ref} {...props} > {/* ... */} </Svg> ) const ForwardRef = forwardRef(SvgUserHeart) export default ForwardRef ``` When using native the type must be `Svg` ```diff import Svg, { Path } from 'react-native-svg' import type { SvgProps } from 'react-native-svg' import { Ref, forwardRef } from 'react' -const Icon = (props: SvgProps, ref: Ref<SVGSVGElement>) => ( +const Icon = (props: SvgProps, ref: Ref<Svg>) => ( <Svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" ref={ref} {...props} > {/* ... */} </Svg> ) const ForwardRef = forwardRef(SvgUserHeart) export default ForwardRef ``` ## Test plan Check updated snapshots
This issue appears to be discussing a feature request or bug report related to the repository. Based on the content, it seems to be still under discussion. The issue was opened by alexandernanberg and has received 5 comments.