-
Notifications
You must be signed in to change notification settings - Fork 91
Assets
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.
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:
index.[platform].jsbundle
main.[platform].jsbundle
index.mobile.jsbundle
main.mobile.jsbundle
index.native.jsbundle
main.native.jsbundle
index.jsbundle
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
.
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.
Fonts are copied into a specific location designated for fonts. The filename (without its extension) is used as resource id.
- Documentation: https://developer.android.com/guide/topics/resources/font-resource
- Location:
res/font
- File types:
.ttf
,.ttc
,.otf
, or.xml
Tracking issue: #1813
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.
- Documentation: https://developer.apple.com/documentation/uikit/text_display_and_fonts/adding_a_custom_font_to_your_app
- Location:
/
- File types:
.ttf
,.otf
Tracking issue: #1185
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
- Documentation: https://developer.android.com/guide/topics/resources/drawable-resource#Bitmap
- Location:
res/drawable
- File types:
.png
,.webp
,.jpg
, or.gif
Tracking issue: #1813