Repository navigation
Commit b8ec87e
fix(react-native): add missing
Summary:
#57369 moved the AssetRegistry into the public API of React Native starting from `0.87`. Unfortunately, it seems that the TypeScript types were not updated to include this API, resulting in type issues when trying to use:
```ts
import { AssetRegistry, type AssetDestPathResolver, type PackagerAsset } from 'react-native'
```
This PR fixes the typing issues for `0.88`.
The [Flow types were updated correctly](https://github.com/react/react-native/blob/2d913c7292088a7bc4482a6febb2ee4903d6f32f/packages/react-native/index.js.flow#L282-L286) in `0.87-rc.0`.
## Changelog:
<!-- Help reviewers and the release process by writing your own changelog entry.
Pick one each for the category and type tags:
[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message
For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->
[GENERAL] [FIXED] Add missing TypeScript types for public `AssetRegistry` API
Pull Request resolved: #58964
Test Plan:
- Prepare any TypeScript project with React Native
- Run type checks for:
`import { AssetRegistry, type AssetDestPathResolver, type PackagerAsset } from 'react-native'`
- Should succeed
Reviewed By: Abbondanzo
Differential Revision: D125060242
Pulled By: fabriziocucci
fbshipit-source-id: 4efadb3647afcac43ecd83472a88d9fb02882905AssetRegistry TypeScript types (#58964)1 parent d026c0f commit b8ec87e
2 files changed
Lines changed: 45 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
144 | 144 | | |
145 | 145 | | |
146 | 146 | | |
| 147 | + | |
147 | 148 | | |
148 | 149 | | |
149 | 150 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
0 commit comments