You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When importing react-bulma-components in a React + TypeScript project with skipLibCheck set to false in the tsconfig.json project file, the project fails to compile. Below is the output after running npm start in the console:
Compiling...
Files successfully emitted, waiting for typecheck results...
Failed to compile.
C:/Code/FunRepo/React/bugtest/rbc-bug-report/node_modules/react-bulma-components/src/components/card/index.d.ts
TypeScript error in C:/Code/FunRepo/React/bugtest/rbc-bug-report/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
3 |
4 | declare const Card: BulmaComponent<{}, 'div'> & {
> 5 | Image: BulmaComponent<ImageProps, 'figure'>;
| ^
6 | Content: BulmaComponent<{}, 'div'>;
7 | Header: BulmaComponent<{}, 'div'> & {
8 | Title: BulmaComponent<{}, 'div'>;
Describe the bug
When importing react-bulma-components in a React + TypeScript project with
skipLibCheck
set to false in thetsconfig.json
project file, the project fails to compile. Below is the output after runningnpm start
in the console:To Reproduce
Steps to reproduce the behavior:
npx create-react-app rbc-bug-report --template typescript
npm install bulma bulma-react-components
tsconfig.json
in the project root directory and setskipLibCheck
tofalse
index.tsx
in the projectsrc
directory and addimport {} from 'react-bulma-components';
to the list of importsnpm start
Expected behavior
The application should compile without error when importing react-bulma-components.
Versions
react-bulma-components:
:4.0.7
bulma
:0.9.3
react
:17.0.2
@types/react
:17.0.9
typescript
:4.3.5
Additional context
I originally noticed this error in the .NET React Web App template.
Proposed Solution
The
ImageProps
type needs to be exported:react-bulma-components/src/components/image/index.d.ts
Line 3 in 7d4d0f5
New:
We need to explicitly import the
ImageProps
type:react-bulma-components/src/components/card/index.d.ts
Line 2 in 7d4d0f5
New:
The text was updated successfully, but these errors were encountered: