Skip to content

fix(react-native): add missing AssetRegistry TypeScript types - #58964

Closed
byCedric wants to merge 2 commits into
react:mainfrom
byCedric:@bycedric/react-native/add-missing-asset-registry-types
Closed

byCedric wants to merge 2 commits into
react:mainfrom
byCedric:@bycedric/react-native/add-missing-asset-registry-types

Conversation

@byCedric

@byCedric byCedric commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

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:

import { AssetRegistry, type AssetDestPathResolver, type PackagerAsset } from 'react-native'

This PR fixes the typing issues for 0.88.

The Flow types were updated correctly in 0.87-rc.0.

Changelog:

[GENERAL] [FIXED] Add missing TypeScript types for public AssetRegistry API

Test Plan:

  • Prepare any TypeScript project with React Native
  • Run type checks for:
    import { AssetRegistry, type AssetDestPathResolver, type PackagerAsset } from 'react-native'
  • Should succeed

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Oct 9, 2026
@byCedric
byCedric force-pushed the @bycedric/react-native/add-missing-asset-registry-types branch from f034407 to 50672a7 Compare October 9, 2026 09:49

@huntie huntie left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great catch, thanks!

@byCedric
byCedric force-pushed the @bycedric/react-native/add-missing-asset-registry-types branch from 50672a7 to bb4597f Compare October 9, 2026 09:55
@facebook-github-tools facebook-github-tools Bot added the Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. label Oct 9, 2026
@huntie

huntie commented Oct 9, 2026

Copy link
Copy Markdown
Collaborator

We should be able to pick this exact commit to 87 once merged.

@byCedric

byCedric commented Oct 9, 2026

Copy link
Copy Markdown
Contributor Author

@huntie it might be slightly harder due to the folder rename in 0.88 (types -> types_DEPRECATED)

@byCedric
byCedric marked this pull request as draft October 9, 2026 10:45
@byCedric

Copy link
Copy Markdown
Contributor Author

Can we get this merged before 0.88 by any chance?

@meta-codesync

meta-codesync Bot commented Oct 13, 2026

Copy link
Copy Markdown

@fabriziocucci has imported this pull request. If you are a Meta employee, you can view this in D125060242.

@meta-codesync meta-codesync Bot closed this in b8ec87e Oct 13, 2026
@meta-codesync meta-codesync Bot added the Merged This PR has been merged. label Oct 13, 2026
@meta-codesync

meta-codesync Bot commented Oct 13, 2026

Copy link
Copy Markdown

@fabriziocucci merged this pull request in b8ec87e.

fabriziocucci pushed a commit that referenced this pull request Oct 14, 2026
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: 4efadb3647afcac43ecd83472a88d9fb02882905
(cherry picked from commit b8ec87e)
@byCedric
byCedric deleted the @bycedric/react-native/add-missing-asset-registry-types branch October 14, 2026 09:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Merged This PR has been merged. p: Expo Partner: Expo Partner Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants