@react-native/assets-registry
Asset support code for React Native.
Last updated 2 years ago by react-native-bot .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install @react-native/assets-registry 
SYNC missed versions from official npm registry.

@react-native/assets-registry

npm package

[!Warning] This package is deprecated (since 0.87) and will be removed in a future release. Use AssetRegistry from react-native (or the react-native/asset-registry build entry point) instead of @react-native/assets-registry/registry, and @react-native/asset-utils instead of @react-native/assets-registry/path-support.

Runtime registry that maps asset IDs generated in a Metro bundle to asset metadata. It backs <Image>, Image.resolveAssetSource(), and any code that resolves require('./img.png') on native.

Most apps never import this directly — assets are handled through <Image>.

API

@react-native/assets-registry/registry (DEPRECATED)

[!Warning] Deprecated: Aliases to AssetRegistry (since 0.87).

Please use:

  • import { AssetRegistry } from 'react-native'; (apps/library code)
  • 'react-native/asset-registry' (entrypoint for Metro/build configs)
Export Signature Notes
registerAsset (asset: PackagerAsset) => number Stores the asset; returns a numeric ID
getAssetByID (assetId: number) => PackagerAsset Looks an asset back up by ID

@react-native/assets-registry/path-support (DEPRECATED)

[!Warning] Deprecated: Use @react-native/asset-utils (since 0.87).

Android resource-path helpers, used when copying assets into drawable-* folders.

Export Signature Notes
getAndroidResourceFolderName (asset: PackagerAsset, scale: number) => string e.g. drawable-xhdpi; non-drawable types resolve to raw
getAndroidResourceIdentifier (asset: PackagerAsset) => string Sanitised resource name
getBasePath (asset: PackagerAsset) => string httpServerLocation without the leading slash

Current Tags

  • 0.74.89                                ...           0.74-stable (2 years ago)
  • 0.75.5                                ...           0.75-stable (2 years ago)
  • 0.76.9                                ...           0.76-stable (2 years ago)
  • 0.77.3                                ...           0.77-stable (a year ago)
  • 0.78.3                                ...           0.78-stable (a year ago)
  • 0.79.7                                ...           0.79-stable (a year ago)
  • 0.80.3                                ...           0.80-stable (10 months ago)
  • 0.81.6                                ...           0.81-stable (10 months ago)
  • 0.83.10                                ...           0.83-stable (5 months ago)
  • 0.86.3                                ...           0.86-stable (3 months ago)
  • 0.74.82                                ...           false (3 years ago)
  • 0.88.1                                ...           latest (a month ago)
  • 0.88.0-rc.6                                ...           next (2 months ago)
  • 0.89.0-nightly-20261001-53237c7d3                                ...           nightly (2 months ago)

1178 Versions

Maintainers (2)
Downloads
Total 640
Today 10
This Week 118
This Month 116
Last Day 106
Last Week 56
Last Month 255
Dependencies (0)
None
Dev Dependencies (0)
None
Dependents (2)

© 2010 - cnpmjs.org x YWFE | Home | YWFE