react-simple-maps icon indicating copy to clipboard operation
react-simple-maps copied to clipboard

Module '"react-simple-maps"' has no exported member 'useZoomPanContext'

Open jbouhier opened this issue 2 years ago • 4 comments

I'm using react-simple-maps + @types/react-simple-maps v3.0.0. useZoomPanContext and all the other hooks from the docs are missing from @types/react-simple-maps's type declarations.

How can I help to fix that @zimrick ?

jbouhier avatar Dec 20 '22 00:12 jbouhier

Wow, good timing, I am facing the exact same problem.

richardfinegan avatar Dec 20 '22 13:12 richardfinegan

@jbouhier Here, this worked for me:

// extraTypings.d.ts import * as ReactSimpleMaps from "react-simple-maps";

declare module "react-simple-maps" { export function useZoomPanContext(): {x: number; y: number; k: number; transformString: string;}; }

richardfinegan avatar Dec 20 '22 15:12 richardfinegan

@richardfinegan I was looking for this workaround. Thank you!

jbouhier avatar Dec 20 '22 18:12 jbouhier

@jbouhier Were you able to use useZoomPanContext() in your app? When I call const ctx = useZoomPanContext(), the return value is undefined.

jesuissuyaa avatar Aug 03 '23 10:08 jesuissuyaa