@molecule/app-splash-screen-react-native
v1.0.1
Published
React Native splash screen provider for molecule.dev (expo-splash-screen)
Maintainers
Readme
@molecule/app-splash-screen-react-native
Auto-generated, AI-first package reference for the molecule.dev ecosystem. It is written to be read by coding agents as much as by people, and is generated from this package's source — edit
src/index.tsJSDoc, not this file.
React Native splash screen provider for molecule.dev.
Implements the SplashScreenProvider interface from @molecule/app-splash-screen
using expo-splash-screen: keeps the native splash visible during startup and
hides it when the app is ready.
Quick Start
import { setProvider, hide } from '@molecule/app-splash-screen'
import { provider } from '@molecule/app-splash-screen-react-native'
setProvider(provider)
// Later — once the root view has rendered / initial data + fonts are ready:
await hide()Type
provider
Installation
npm install @molecule/app-splash-screen-react-native @molecule/app-i18n @molecule/app-logger @molecule/app-splash-screen expo-splash-screenAPI
Interfaces
ReactNativeSplashScreenConfig
Configuration for the React Native splash screen provider.
interface ReactNativeSplashScreenConfig {
/**
* Whether to prevent auto-hide on app launch.
* When true, the splash screen stays visible until explicitly hidden.
* @default true
*/
preventAutoHide?: boolean
}Functions
createReactNativeSplashScreenProvider(config)
Creates a React Native splash screen provider backed by expo-splash-screen.
function createReactNativeSplashScreenProvider(
config?: ReactNativeSplashScreenConfig,
): SplashScreenProviderconfig— Optional provider configuration.
Returns: A SplashScreenProvider implementation for React Native.
Constants
provider
Default React Native splash screen provider.
const provider: SplashScreenProviderCore Interface
Implements @molecule/app-splash-screen interface.
Bond Wiring
Setup function to register this provider with the core interface:
import { setProvider } from '@molecule/app-splash-screen'
import { provider } from '@molecule/app-splash-screen-react-native'
export function setupNativeSplashScreenReactNative(): void {
setProvider(provider)
}Injection Notes
Requirements
Peer dependencies:
@molecule/app-i18n^1.0.1@molecule/app-logger^1.0.1@molecule/app-splash-screen^1.0.1expo-splash-screen>=0.20.0
Runtime Dependencies
@molecule/app-i18n@molecule/app-logger@molecule/app-splash-screenexpo-splash-screenCreating the default
providerimmediately arms prevent-auto-hide (configpreventAutoHidedefaults totrue): the native splash stays up until the app explicitly callshide(). If the app appears to hang on the splash forever, the missinghide()call is why. UsecreateReactNativeSplashScreenProvider({ preventAutoHide: false })to keep the OS auto-hide behavior.expo-splash-screenis loaded on demand — install withnpx expo install expo-splash-screen.show()/hide()OPTIONS (fade, duration, spinner) are ignored on this platform —getCapabilities()reportsspinnerSupported: false, configurable: false. Style the splash via the Expo config plugin (app.json→expo-splash-screen), not at runtime.show()cannot bring back an already-hidden splash; it only re-arms prevent-auto-hide for the current launch.
Translations
Translation strings are provided by @molecule/app-locales-splash-screen.
