# Type alias CustomComponentPropsWithRef<T>

CustomComponentPropsWithRef<T>: T extends (new (props) => Component<any, any>)
? PropsWithoutRef<P> & RefAttributes<InstanceType<T>>
: T extends ((props, legacyContext?) => ReactNode)
? PropsWithRef<P>
: never

Used to retrieve the props a custom component accepts with its ref.

Unlike ComponentPropsWithRef, this only works with custom components, i.e. components you define yourself. This is to improve type-checking performance.

#### Type Parameters

- T extends ComponentType

#### Example

    const MyComponent = (props: { foo: number, bar: string }) => <div />;

    // Retrieves the props 'MyComponent' accepts
    type MyComponentPropsWithRef = React.CustomComponentPropsWithRef<typeof MyComponent>;

- Defined in common/temp/node_modules/.pnpm/@types+react@18.3.3/node_modules/@types/react/index.d.ts:1700