-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Closed
Labels
Description
Current behaviour
node_modules/react-native-paper/src/utils/forwardRef.tsx:21:14 - error TS2322: Type '<T, P = {}>(render: ForwardRefRenderFunction<T, PropsWithoutRef<P>>) => ForwardRefExoticComponent<PropsWithoutRef<P> & RefAttributes<T>>' is not assignable to type '<T, P = {}>(render: ForwardRefRenderFunction<T, P>) => ForwardRefComponent<T, P>'.
Types of parameters 'render' and 'render' are incompatible.
Type 'ForwardRefRenderFunction<T, P>' is not assignable to type 'ForwardRefRenderFunction<T, PropsWithoutRef<P>>'.
Types of parameters 'props' and 'props' are incompatible.
Type 'PropsWithoutRef<P>' is not assignable to type 'P'.
'P' could be instantiated with an arbitrary type which could be unrelated to 'PropsWithoutRef<P>'.
Expected behaviour
type checking should complete without errors
How to reproduce?
- clone/download https://snack.expo.dev/@the-tablet/6dd396
- run
tsc --noEmitin the project directory
Preview
N/A
What have you tried so far?
- redeclaring typescript module
react-native-paper/src/utils/forwardRef.tsx
import 'react-native-paper/src/utils/forwardRef';
declare module 'react-native-paper/src/utils/forwardRef' {
export declare const forwardRef: <T, P = {}>(
render: ForwardRefRenderFunction<T, PropsWithoutRef<P>>
) => ForwardRefComponent<T, P> = React.forwardRef;
}- adding
skipLibCheck: trueto tsconfig.json - explicitly adding
node_modules/react-native-paper/srcto theexcludearray in tsconfig.json - upgrading react-native-paper to the latest version
Your Environment
| software | version |
|---|---|
| ios | n/a |
| android | 35 |
| react-native | 0.76.6 |
| react-native-paper | 5.13.1 |
| node | 22.12.0 |
| npm or yarn | yarn 1.22.22 |
| expo sdk | N/A |
JairajJangle