After following the instructions in the documentation to create a sample project, I used the command below:
npx react-native init MyApp --template react-native-template-typescript
Upon starting the project and running the command
tsc
I encountered 183 errors, all of which originated from the node_modules directory.
3237 use: React.SVGProps<SVGUseElement>;
~~~
node_modules/@types/react/index.d.ts:3234:13
3234 use: React.SVGProps<SVGUseElement>;
~~~
'use' was also declared here.
node_modules/@types/react-test-renderer/node_modules/@types/react/index.d.ts:3238:13 - error TS2717: Subsequent property declarations must have the same type. Property 'view' must be of type 'SVGProps<SVGViewElement>', but here has type 'SVGProps<SVGViewElement>'.
3238 view: React.SVGProps<SVGViewElement>;
~~~~
node_modules/@types/react/index.d.ts:3235:13
3235 view: React.SVGProps<SVGViewElement>;
~~~~
'view' was also declared here.
node_modules/@types/react/index.d.ts:3047:14 - error TS2300: Duplicate identifier 'LibraryManagedAttributes'.
3047 type LibraryManagedAttributes<C, P> = C extends React.MemoExoticComponent<infer T> | React.LazyExoticComponent<infer T>
~~~~~~~~~~~~~~~~~~~~~~~~
node_modules/@types/react-test-renderer/node_modules/@types/react/index.d.ts:3048:14
3048 type LibraryManagedAttributes<C, P> = C extends React.MemoExoticComponent<infer T> | React.LazyExoticComponent<infer T>
~~~~~~~~~~~~~~~~~~~~~~~~
'LibraryManagedAttributes' was also declared here.
Found 183 errors.
The current workaround involves adding the line
"skipLibCheck": true
to the tsconfig file, although this causes the compiler to ignore all .d.ts files outside the node_modules directory.