react-native-code-push-utils
TypeScript icon, indicating that this package has built-in type declarations

0.6.0 • Public • Published

react-native-code-push-utils

Utilities for CodePush

Installation

npm install react-native-code-push-utils

or

yarn add react-native-code-push-utils

Usage

Default CodePush config

import CodePushProvider from "react-native-code-push-utils";
import App from "./App";

export default function Root() {
    return (
        <CodePushProvider>
            <App />
        </CodePushProvider>
    )
}

Custom CodePush config

import codePush from "react-native-code-push";
import {CodePushProvider} from "react-native-code-push-utils";
import App from "./App";

function Root() {
    return (
        <CodePushProvider>
            <App />
        </CodePushProvider>
    )
}

const config = {...};
export default codePush(config)(Root);

Hooks

import {useCodePush} from "react-native-code-push-utils";

function App() {
    const { status } = useCodePush();
    return <Text>{status}</Text>
}

Splash screen component

import CodePushProvider, { CodePushSplashScreen } from 'react-native-code-push-utils';

const Root = () => (
  <CodePushProvider>
    <CodePushSplashScreen>
      <View>
        <Text>Hello, app</Text>
      </View>
    </CodePushSplashScreen>
  </CodePushProvider>
);

With timeout

import CodePushProvider, { CodePushSplashScreen } from 'react-native-code-push-utils';

const TIMEOUT_MS = 15 * 1000; // 15 seconds timeout

const Root = () => (
  <CodePushProvider>
    <CodePushSplashScreen timeout={TIMEOUT_MS}>
      <View>
        <Text>Hello, app</Text>
      </View>
    </CodePushSplashScreen>
  </CodePushProvider>
);

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT

/react-native-code-push-utils/

    Package Sidebar

    Install

    npm i react-native-code-push-utils

    Weekly Downloads

    0

    Version

    0.6.0

    License

    MIT

    Unpacked Size

    46.7 kB

    Total Files

    21

    Last publish

    Collaborators

    • bhaskarmurthy