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

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

Open
jbouhier opened this issue Dec 20, 2022 · 4 comments
Open

Comments

@jbouhier
Copy link

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 ?

@richardfinegan
Copy link

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

@richardfinegan
Copy link

richardfinegan commented Dec 20, 2022

@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;};
}

@jbouhier
Copy link
Author

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

@jesuissuyaa
Copy link

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

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

No branches or pull requests

3 participants