2015-01-29 17:10:49 -08:00
|
|
|
/**
|
|
|
|
* Copyright 2004-present Facebook. All Rights Reserved.
|
|
|
|
*
|
|
|
|
* @providesModule renderApplication
|
|
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
|
2015-03-12 12:51:44 -07:00
|
|
|
var PushNotificationIOS = require('PushNotificationIOS');
|
2015-01-29 17:10:49 -08:00
|
|
|
var React = require('React');
|
|
|
|
|
|
|
|
var invariant = require('invariant');
|
|
|
|
|
|
|
|
function renderApplication(RootComponent, initialProps, rootTag) {
|
|
|
|
invariant(
|
|
|
|
rootTag,
|
|
|
|
'Expect to have a valid rootTag, instead got ', rootTag
|
|
|
|
);
|
2015-03-12 12:51:44 -07:00
|
|
|
var pushNotification = initialProps.launchOptions &&
|
|
|
|
initialProps.launchOptions.remoteNotification &&
|
|
|
|
new PushNotificationIOS(initialProps.launchOptions.remoteNotification);
|
|
|
|
React.render(
|
|
|
|
<RootComponent
|
|
|
|
pushNotification={pushNotification}
|
|
|
|
{...initialProps}
|
|
|
|
/>,
|
|
|
|
rootTag
|
|
|
|
);
|
2015-01-29 17:10:49 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
module.exports = renderApplication;
|