couds / react-bulma-components

React components for Bulma framework
MIT License
1.2k stars 126 forks source link

Fix React Typescript compilation error #360

Closed zprobinson closed 3 years ago

zprobinson commented 3 years ago

I get the following error with current setup:

TypeScript error in V:/../../../ClientApp/node_modules/react-bulma-components/src/components/card/index.d.ts(5,25):
'ImageProps' refers to a value, but is being used as a type here. Did you mean 'typeof ImageProps'? TS2749

Typescript version 4.3.5 with following tsconfig.json:

{
  "compilerOptions": {
    "target": "es5",
    "allowJs": true,
    "esMOduleInterop": true,
    "allowSyntheticDefaultImports": true,
    "strict": true,
    "forceConsistentCasingInFileNames": true,
    "module": "esnext",
    "moduleResolution": "node",
    "resolveJsonModule": true,
    "isolatedModules": true,
    "noEmit": true,
    "jsx": "react-jsx",
    "lib": ["es6, "dom", "es2016", "es2017"[,
    "skipLibCheck": false,
    "noFallthroughCasesInSwitch": true
  },
  "include": ["src"]
}

Following the recommended steps above fixed it in my application and I figured I would propose the change here in case it was something that made sense to update.

zprobinson commented 3 years ago

I appreciate your response and research into this. I prefer your issue/PR over mine. I will close this and support your solution.