smucode / react-world-flags

Easy to use SVG flags of the world for react
https://smucode.github.io/react-world-flags/
MIT License
146 stars 40 forks source link

Type errors #674

Closed Eusebiotrigo closed 1 year ago

Eusebiotrigo commented 1 year ago

I'm getting the following error:

Type error: 'Flag' cannot be used as a JSX component.
  Its type 'FC<FlagProps>' is not a valid JSX element type.
    Type 'FunctionComponent<FlagProps>' is not assignable to type '(props: any, deprecatedLegacyContext?: any) => ReactNode'.
      Type 'import("/Users/some-path/node_modules/@types/react-simple-maps/node_modules/@types/react/index").ReactNode' is not assignable to type 'React.ReactNode'.

After the following updates:

Package From To
@clerk/nextjs 4.24.1 4.25.1
@tanstack/react-query 4.35.3 4.35.7
@tanstack/react-table 8.10.1 8.10.3
axios 1.5.0 1.5.1
flowbite-react 0.6.1 0.6.3
next 13.5.2 13.5.3
@types/node 18.17.19 18.18.1
@types/react 18.2.22 18.2.24
@types/react-simple-maps 3.0.0 3.0.1
@types/react-world-flags 1.4.2 1.4.3
@typescript-eslint/eslint-plugin 6.7.2 6.7.3
@typescript-eslint/parser 6.7.2 6.7.3
eslint-config-next 13.5.2 13.5.3
postcss 8.4.30 8.4.31
Eusebiotrigo commented 1 year ago

It works with @types/react 18.2.23.

smucode commented 1 year ago

Just bumped the project deps. Let me know if that didn't solve it.

Eusebiotrigo commented 1 year ago

Thanks for releasing and updating the dependencies. I just tried and sadly, it did not fix the type issue with the Flag component.

Eusebiotrigo commented 1 year ago

Ok, this type issue seems to be more with https://www.npmjs.com/package/@types/react-world-flags in https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react-world-flags than with the library you created.

Ok, there is an issue about it https://github.com/DefinitelyTyped/DefinitelyTyped/issues/66841

Thanks!!