Skip to content

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 βœ“ 𐄂 𐄂

Enable single-app mode

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.

Clone this wiki locally