Skip to content
Tommy Nguyen edited this page Feb 2, 2024 · 18 revisions

Warning

This page is still being written.

Contents

All assets that should be embedded in the final app bundle must be declared in app.json under the resources field. Unless stated otherwise, assets are copied as-is into the app bundle as raw assets.

Read on to learn how we handle certain resource types.

JavaScript Bundle

When the app is instructed to load the embedded JS bundle, it will look for and load the first file it finds from the list, starting from the top:

  1. index.[platform].jsbundle
  2. main.[platform].jsbundle
  3. index.mobile.jsbundle
  4. main.mobile.jsbundle
  5. index.native.jsbundle
  6. main.native.jsbundle
  7. index.jsbundle
  8. main.jsbundle

When loading from the dev server, the app will attempt to load http://localhost:8081/index.bundle by default.

You can tell RNTA to use a different filename by configuring bundleRoot.

Fonts

Warning

Not yet implemented!

This is just a draft of how we think it should work. If you have any feedback, leave them in the linked issue.

Android

Fonts are copied into a specific location designated for fonts. The filename (without its extension) is used as resource id.

Tracking issue: #1813

iOS/macOS

Fonts are copied as-is into the app bundle, but must be registered in Info.plist before they can be used. Note that the font name may not match the filename. Check the documentation for how to find the font name.

Tracking issue: #1185

Images

Warning

Not yet implemented!

This is just a draft of how we think it should work. If you have any feedback, leave them in the linked issue.

Note

This only applies to images in a hybrid app. In most cases, you should let React Native manage images: https://reactnative.dev/docs/next/images

Android

Tracking issue: #1813

Clone this wiki locally