Open janis91 opened 6 years ago
I added type definitions. @types/react-simple-maps
@thepocp Thanks! I'm running into an issue, though, where trying to add an onClick
handler to <Geography>
is resulting in a compiler error:
Type '{ key: number; geography: any; projection: (point: [number, number]) => void; onClick: (e: SyntheticEvent<Element, Event>) => void; style: { default: any; hover: { fill: string; stroke: string; strokeWidth: number; outline: string; }; pressed: { ...; }; }; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes<Geography> & Readonly<{ children?: ReactNode; }> & Readonly<GeographyProps>'.
Property 'onClick' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes<Geography> & Readonly<{ children?: ReactNode; }> & Readonly<GeographyProps>'.
For the code that's being used, it's based on this example.
@chrisbodhi I fixed it
@thepocp thanks for that!
As of Jan. 2, 2020, it looks like the published types are for for 0.12.2
but the current version is 1.0.0-beta.0
which causes mismatches.
I created a pull request: https://github.com/DefinitelyTyped/DefinitelyTyped/pull/41370
I'm having some trouble with the projection
prop on ComposableMap
. It's type is string | ProjectionFunction
but as far as I can tell from the code it should be string | GeoProjection
. Is that correct? Should I create a PR?
It seems that the types for react-simple-maps have fallen significantly behind the current version.
I am wondering if there is already someone who started with the type definitions for this project. I think it would open the project for an even bigger audience.
What is your opinion on that?