Skip to content

Latest commit

 

History

History
65 lines (33 loc) · 1.61 KB

withCodePush.md

File metadata and controls

65 lines (33 loc) · 1.61 KB

@appzung/react-native-code-push v11.0.0-rc3


@appzung/react-native-code-push / withCodePush

Function: withCodePush()

Call Signature

withCodePush<P>(component): ComponentType

Wraps a React component inside a "higher order" React component that knows how to synchronize your app's JavaScript bundle and image assets when it is mounted.

Internally, the higher-order component calls sync inside its componentDidMount lifecycle handle, which in turns performs an update check, downloads the update if it exists and installs the update for you.

Type Parameters

P extends object

Parameters

component

ComponentType<P>

the React Component that will be decorated

Returns

ComponentType

Call Signature

withCodePush<P>(options): (component) => ComponentType

Wraps a React component inside a "higher order" React component that knows how to synchronize your app's JavaScript bundle and image assets when it is mounted.

Internally, the higher-order component calls sync inside its componentDidMount lifecycle handle, which in turns performs an update check, downloads the update if it exists and installs the update for you.

Type Parameters

P extends object

Parameters

options

CodePushOptions

Options used to configure the end-user sync and update experience (e.g. when to check for updates?, show a prompt?, install the update immediately?).

Returns

Function

Parameters

component

ComponentType<P>

Returns

ComponentType