Command palette

@yasinsensoy/native

React Native · APIs and utilities

App

Registers the app's root component.

2 exports

Import

import { registerApp, APP_COMPONENT_NAME } from "@yasinsensoy/native";

registerApp

function

Registers the app's root component. Call it once in index.js instead of AppRegistry.registerComponent; the app needs no app.json, because the native projects open the fixed APP_COMPONENT_NAME that sync writes into them.

registerApp(component: ComponentType): void

Examples

import { registerApp } from "@yasinsensoy/native/app";

// App: the root component of your app.
registerApp(App);

Name the root component is registered under. sync writes it into the native projects (getMainComponentName on Android, withModuleName on iOS), so the app's display and project name (ui.config name) can change without touching the JavaScript entry.

APP_COMPONENT_NAME: export declare const APP_COMPONENT_NAME = "main"