The package.json in my project has
“react-native-safe-area-context”: “^4.7.1”
while the podfile.lock shows a different version.
- react-native-safe-area-context (4.10.9):
which I believe is causing a typescript error
<code>node_modules/react-native-safe-area-context/src/SafeAreaContext.tsx(148,27): error TS2345: Argument of type '(props: T, ref: React.Ref<unknown>) => React.JSX.Element' is not assignable to parameter of type 'ForwardRefRenderFunction<unknown, PropsWithoutRef<T>>'.
Types of parameters 'props' and 'props' are incompatible.
Type 'PropsWithoutRef<T>' is not assignable to type 'T'.
'T' could be instantiated with an arbitrary type which could be unrelated to 'PropsWithoutRef<T>'.
</code>
<code>node_modules/react-native-safe-area-context/src/SafeAreaContext.tsx(148,27): error TS2345: Argument of type '(props: T, ref: React.Ref<unknown>) => React.JSX.Element' is not assignable to parameter of type 'ForwardRefRenderFunction<unknown, PropsWithoutRef<T>>'.
Types of parameters 'props' and 'props' are incompatible.
Type 'PropsWithoutRef<T>' is not assignable to type 'T'.
'T' could be instantiated with an arbitrary type which could be unrelated to 'PropsWithoutRef<T>'.
</code>
node_modules/react-native-safe-area-context/src/SafeAreaContext.tsx(148,27): error TS2345: Argument of type '(props: T, ref: React.Ref<unknown>) => React.JSX.Element' is not assignable to parameter of type 'ForwardRefRenderFunction<unknown, PropsWithoutRef<T>>'.
Types of parameters 'props' and 'props' are incompatible.
Type 'PropsWithoutRef<T>' is not assignable to type 'T'.
'T' could be instantiated with an arbitrary type which could be unrelated to 'PropsWithoutRef<T>'.
tried deleting node_modules and then running
yarn install
followed by
rm -rf ios/pods ios/Podfile
and then pod install
but nothing seems to fix the typescript.
Also tried install react-native-safe-area-view
but to no success.
1