Skip to main content

Module constants

Constants declaration

src/NativeMyAwesomeModule.ts
import type { TurboModule } from 'react-native';
import { TurboModuleRegistry } from 'react-native';

// ...

export interface Spec extends TurboModule {
getConstants(): { ALONSO: string, HAMILTON: string, LATIFI: string, VERSTAPPEN: string }
}

export default TurboModuleRegistry.getEnforcing<Spec>('MyAwesomeModule');