4

I moved a big project to a "create-react-app" with typescript enabled.

In my previous conf I did not have any typescript errors but now I get errors of this kind:

Type '{ pset: string; propertyName: string; projectId: string; doUpdate: (pset: any, propertyName: any) => Promise<void>; }' is not assignable to type '(IntrinsicAttributes & IntrinsicClassAttributes<Component<Pick<unknown, never> | (Pick<Pick<unknown, never>, never> & Pick<InferProps<unknown>, never>) | (Pick<Pick<Pick<unknown, never>, never> & Pick<InferProps<unknown>, never>, never> & Partial<...> & Partial<...>) | (Pick<...> & ... 1 more ... & Partial<...>), an...'.

I'm using redux. This is a common problem: Typescript + React/Redux: Property "XXX" does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes

It's very tricky to solve and I don't have time with changing manually in hundreds of files. Adding a @ts-ignore on every of this error is not an option

Is there anything I can do globally to fix this? Some option in my tsconfig.json?

This is my tsconfig.json:

{
  "compilerOptions": {
    "target": "es5",
    "lib": [
      "dom",
      "dom.iterable",
      "esnext"
    ],
    "allowJs": true,
    "skipLibCheck": true,
    "esModuleInterop": true,
    "allowSyntheticDefaultImports": true,
    "strict": false,
    "forceConsistentCasingInFileNames": false,
    "module": "esnext",
    "moduleResolution": "node",
    "resolveJsonModule": true,
    "isolatedModules": true,
    "noEmit": true,
    "jsx": "react"
  },
  "include": [
    "src"
  ],
  "exclude": ["node_modules"]
}
Joe
  • 4,274
  • 32
  • 95
  • 175

0 Answers0