reactjs - React Native:在向组件传递内联 style 属性时,出现错误“Property 'style' does not exist on type 'IntrinsicAttributes & ...'”
通过阅读其他 SO 问题/答案,我理解这个问题的解决方法(只需将 style 添加到我组件的 props 对象中),但我不明白为什么这是必要的。
style 不是 IntrinsicAttribute 吗?!如果是的话,为什么还需要像这样在我的组件的 props 对象中显式定义它:
export const MyComponent = ({ ...other props, style }) => {
// Component body redacted for brevity
};