diff --git a/packages/react/src/AsForwarder.tsx b/packages/react/src/AsForwarder.tsx index 6533b6217..2336dd982 100644 --- a/packages/react/src/AsForwarder.tsx +++ b/packages/react/src/AsForwarder.tsx @@ -1,9 +1,20 @@ import React from 'react'; import Svg from 'react-native-svg'; +import type { ViewProps } from 'react-native'; -const AsForwarder = ({ as, children, ...props }: any) => { +export interface InterfaceAsForwardedProps extends ViewProps { + as?: any; +} + +const AsForwarderTemp = ({ + as, + children, + ...props +}: any): React.ReactElement => { const As: any = as; return as ? {children} : {children}; }; -AsForwarder.displayName = '__AsForwarder__'; -export { AsForwarder }; +AsForwarderTemp.displayName = '__AsForwarder__'; + +export const AsForwarder = + AsForwarderTemp as React.ComponentType;