I created a native module using Swift called CounterView, and when I use it as such:
<CounterView style={{flex: 1}} />
I get this nasty warning! But the thing is, everything works. The error goes away if I remove the style prop, but nothing would render without the {flex: 1}. So I tried to wrap this inside a View, but then it renders relative to the entire screen rather than the wrapper. How can I get rid of this error? Am I doing something wrong to make my component "read-only"?
Type '{ style: { flex: number; }; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes<Component<unknown, {}, any> & Readonly<NativeMethods>> & Readonly<...> & Readonly<...>'. Property 'style' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes<Component<unknown, {}, any> & Readonly<NativeMethods>> & Readonly<...> & Readonly<...>'.
I can circumvent the issue if I do this:
<View style={{flex: 1}}><View style={{flex: 1}} /><View style={{flex: 1}}><CounterView /></View></View>
This takes care of the other half of the screen that will be occupied by another flex:1 container, but this looks pretty silly.