React Native: Getting error "Property 'style' does not exist on type 'IntrinsicAttributes & ..." when passing inline style prop to component

Viewed 969

From reading other SO questions/answers I understand the solution to this problem (simply add style to my component's props object) but I don't understand why this is necessary.

Isn't style an IntrinsicAttribute?! If so, why is it necessary to explicitly define it in my component's props object, like so:

export const MyComponent = ({ ...other props, style }) => {
    // Component body redacted for brevity
};
0 Answers
Related