Skip to content

fix: re-export AssetRegistry from the react-native components shim - #504

Open
oJaqob wants to merge 1 commit into
nativewind:mainfrom
oJaqob:fix/export-asset-registry
Open

oJaqob wants to merge 1 commit into
nativewind:mainfrom
oJaqob:fix/export-asset-registry

Conversation

@oJaqob

@oJaqob oJaqob commented Oct 17, 2026

Copy link
Copy Markdown

What

Adds AssetRegistry to the react-native-css/components re-exports.

Why

The Metro resolver sends react-native imports from node_modules to this file. React Native 0.88 added AssetRegistry to its public exports, and expo-asset does import { AssetRegistry } from 'react-native'. Without this getter, expo-asset receives undefined and every asset load fails:

TypeError: Cannot read property 'getAssetByID' of undefined
    at fromModule (expo-asset/build/Asset.js)

In an app this shows up as useFonts failing and the app silently falling back to system fonts.

I compared the export list of react-native/index.js (0.88.0) with this file. AssetRegistry was the only name missing.

Checked

  • Reproduced on Android with react-native 0.88.0, expo 58.0.13 and expo-asset 58.0.16: fonts fell back to the system font before the change and load correctly after it.
  • I haven't run the repo's own test suite.

This branch has not been deployed

No deployments
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

Successfully merging this pull request may close these issues.

1 participant