react-use: Typescript 4.1.2 fails with "Cannot find name 'PositionError'"

What is the current behavior? I’ve got an error

node_modules/react-use/lib/useGeolocation.d.ts(11,21): error TS2304: Cannot find name 'PositionError'.

react-use: 15.3.4 typescript: 4.1.2

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 20
  • Comments: 16 (9 by maintainers)

Commits related to this issue

Most upvoted comments

solved the problem by adding in global.d.ts

type PositionError = GeolocationPositionError;

🎉 This issue has been resolved in version 15.3.7 🎉

The release is available on:

Your semantic-release bot 📦🚀

It seems like PositionError was changed to GeolocationPositionError in this version of Typescript.

@dovidweisz made a bit overkill the easiest way is to introduce own interface compatible with GeolocationPositionError

Seems doable, but I would flip that around

I agree 👍