Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "lib/registerScreen"

Index

Type aliases

IRegisterScreenOptions

Functions

isIRegisterScreenOptions

registerScreen

  • Used to register the screen to the library.

    example
    screen/Main/register.tsx ```ts import { registerScreen } from '@ef-carbon/react-native-navigation'; import Component from './Component'; // There are various options here, see IRegisterScreenOptions registerScreen({ Class: Component, title: 'My Specific Title' }); ```
    example
    screen/Main/index.tsx ```ts import Component from './Component'; export * from './Component'; // This does the registration of the component // It can be removed and the component will work just like normal import './register'; // tslint:disable-line:no-import-side-effect export default Component; ```
    example
    screen/Main/Component.tsx ```ts import * as React from 'react'; import { Button, View } from 'react-native'; import Navigation, { push } from '@ef-carbon/react-native-navigation';

    import OtherScreen from '../OtherScreen';

    import styles from './styles';

    // The Main screen must have zero properties // If this wasn't the main screen, it could have any properties // When other screens navigate to it they will need to provide the // necessary properties for the component // tslint:disable-next-line:no-empty-interface export interface IProps { }

    export class MainScreen extends React.PureComponent { // tslint:disable-next-line:no-any render(): React.ReactElement { return (

    example
    screen/Main/styles.tsx ```ts import { StyleSheet } from 'react-native';

    export default StyleSheet.create({ container: { flex: 1, backgroundColor: '#fff', alignItems: 'center', justifyContent: 'center' } }); `

    Type parameters

    • P

    Parameters

    Returns void