Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JSX element type 'FastImage' does not have any construct or call signatures #646

Closed
devmartinez0 opened this issue Mar 10, 2020 · 5 comments · Fixed by #647
Closed

JSX element type 'FastImage' does not have any construct or call signatures #646

devmartinez0 opened this issue Mar 10, 2020 · 5 comments · Fixed by #647
Labels

Comments

@devmartinez0
Copy link

Describe the bug
When I try to use the imported FastImage package, I get the following error in the component: "JSX element type 'FastImage' does not have any construct or call signatures."

To Reproduce

  1. Create a ReactNative project with typescript
  2. In a .tsx file, type import the package using the following: import FastImage from 'react-native-fast-image';
  3. Try to use the component, you will get the error in the declaration.

Expected behavior
Not showing any error

Screenshots
Screenshot_2
Screenshot_1

Dependency versions

  • React Native version: 0.61.1
  • React version: 16.8.1
  • React Native Fast Image version: 8.1.2
@mtakac
Copy link

mtakac commented Mar 11, 2020

Same thing is happens to me. Didn't really have time to look into it, but in v7.0.2 the import works as documented.

@devmartinez0
Copy link
Author

devmartinez0 commented Mar 11, 2020

I just added declare module 'react-native-fast-image'; to a .d.ts file and the error is gone, but also the types. I will be using it like this while finding a better solution.

I want to avoid downgrading to an older version, but thanks for the hint @mtakac

@DylanVann
Copy link
Owner

Types should be better in the future. The source and example are now both in TypeScript.

@pvshum
Copy link

pvshum commented Jun 27, 2022

The issue still exist. Any hints on how to fix?

Dependency versions

  • "react": "17.0.2",
  • "react-native": "0.68.2",
  • "react-native-fast-image": "8.5.11",
  • "typescript": "^3.8.3"

Screenshot 2022-06-27 at 11 13 13

@forbesgillikin
Copy link

This is an issue with the @types/react package. Adding

"resolutions": {
    "@types/react": "17.0.43"
  }

to your package.json if using yarn will solve this.

DefinitelyTyped/DefinitelyTyped#59765 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants