diff --git a/src/types/PolymorphicComponentProps/PolymorphicComponentProps.mdx b/src/types/PolymorphicComponentProps/PolymorphicComponentProps.mdx index 1d1d27e..d51ab55 100644 --- a/src/types/PolymorphicComponentProps/PolymorphicComponentProps.mdx +++ b/src/types/PolymorphicComponentProps/PolymorphicComponentProps.mdx @@ -19,7 +19,7 @@ type FooComponentProps = PolymorphicComponentProps< { barProp: string | undefined } >; -type FooComponent = (props: FooComponentProps) => ReactElement | null; +type FooComponent = (props: FooComponentProps) => ReactNode | null; export const Foo: FooComponent = ({ as: Component = 'div', @@ -68,16 +68,18 @@ type FooComponentProps = PolymorphicComponentPropsWithRef { barProp: string | undefined } >; -type FooComponent = (props: FooComponentProps) => ReactElement | null; - -export const Foo: FooComponent = ( - { as: Component = 'div', children, ...otherProps }: FooComponentProps, - ref?: PolymorphicRef, -) => { - return ( - - {children} - - ); -}; +type FooComponent = (props: FooComponentProps) => ReactNode | null; + +export const Foo: FooComponent = forwardRef( + ( + { as: Component = 'div', children, ...otherProps }: FooComponentProps, + ref?: PolymorphicRef, + ) => { + return ( + + {children} + + ); + }, +); ```