-
Notifications
You must be signed in to change notification settings - Fork 94
Single app Mode
Tommy Nguyen edited this page Mar 23, 2022
·
14 revisions
In single-app mode, a component is launched automatically, essentially behaving like a normal app.
The differences can be summed up in the table below:
Feature | Multi-app | Single-app (debug) | Single-app (release) |
---|---|---|---|
Launch component automatically | π | β | β |
Component picker | β | π | π |
React dev menu | β | β | π |
Auto-detect components | β | π | π |
To enable single-app mode, first assign a slug to your target component, then set singleApp
to the slug. For instance, to launch the component com.contoso.Example
:
{
"$schema": "https://raw.githubusercontent.com/microsoft/react-native-test-app/trunk/schema.json",
"name": "Example",
"displayName": "Example",
+ "singleApp": "com.contoso.Example",
"components": [
{
"appKey": "Example",
"displayName": "App",
+ "slug": "com.contoso.Example"
},
{
"appKey": "Example",
"displayName": "App (modal)",
"presentationStyle": "modal"
}
],
"resources": {
...
}
}
Save and regenerate your project (pod install
on iOS/macOS or yarn install-windows-test-app
on Windows), then build your app.