I want to create a React Native component with types like this that takes a component and applies some styles to it:
interface Props { component: any; } const Component: React.FC<Props> = ({component}) => { const Styled = styled(component)` background-color: red; `; }
What I want is to get the prop types of the component passed in the props like this:
<Component component={Pressable} onPress={() => console.log("sds")} /> //Should accept this props<Component component={Image} source={{}} /> //Should accept Image props
How can I achieve this? Thanks in advance.