diff --git a/.changeset/clever-olives-shake.md b/.changeset/clever-olives-shake.md index bb3641923d..2dd0bac179 100644 --- a/.changeset/clever-olives-shake.md +++ b/.changeset/clever-olives-shake.md @@ -38,3 +38,23 @@ try { } } ``` + +Yet another issue you might run into when upgrading TypeScript is incompatibilities in the types from `react-use`. The error you would run into looks something like this: + +```plain +node_modules/react-use/lib/usePermission.d.ts:1:54 - error TS2304: Cannot find name 'DevicePermissionDescriptor'. + +1 declare type PermissionDesc = PermissionDescriptor | DevicePermissionDescriptor | MidiPermissionDescriptor | PushPermissionDescriptor; +``` + +If you encounter this error, the simplest fix is to replace full imports of `react-use` with more specific ones. For example, the following: + +```ts +import { useAsync } from 'react-use'; +``` + +Would be converted into this: + +```ts +import useAsync from 'react-use/lib/useAsync'; +``` diff --git a/.changeset/stupid-baboons-hug.md b/.changeset/stupid-baboons-hug.md index 22b4ee508f..cc8bf5d8ce 100644 --- a/.changeset/stupid-baboons-hug.md +++ b/.changeset/stupid-baboons-hug.md @@ -40,3 +40,23 @@ try { } } ``` + +Yet another issue you might run into when upgrading TypeScript is incompatibilities in the types from `react-use`. The error you would run into looks something like this: + +```plain +node_modules/react-use/lib/usePermission.d.ts:1:54 - error TS2304: Cannot find name 'DevicePermissionDescriptor'. + +1 declare type PermissionDesc = PermissionDescriptor | DevicePermissionDescriptor | MidiPermissionDescriptor | PushPermissionDescriptor; +``` + +If you encounter this error, the simplest fix is to replace full imports of `react-use` with more specific ones. For example, the following: + +```ts +import { useAsync } from 'react-use'; +``` + +Would be converted into this: + +```ts +import useAsync from 'react-use/lib/useAsync'; +```