1 |
|
2 |
|
3 | import React from 'react';
|
4 | import { AppRegistry, StyleSheet } from 'react-native';
|
5 |
|
6 | import Constants from './Constants';
|
7 | import { processFontFamily } from './Font';
|
8 | import Notifications from './Notifications';
|
9 |
|
10 | function wrapWithExponentRoot(AppRootComponent: ReactClass<{}>) {
|
11 | class ExponentRootComponent extends React.Component {
|
12 | componentWillMount() {
|
13 | StyleSheet.setStyleAttributePreprocessor('fontFamily', processFontFamily);
|
14 |
|
15 | if (this.props.exp.notification) {
|
16 | Notifications._setInitialNotification(this.props.exp.notification);
|
17 | }
|
18 | }
|
19 |
|
20 | render() {
|
21 | return <AppRootComponent {...this.props} />;
|
22 | }
|
23 | }
|
24 |
|
25 | return ExponentRootComponent;
|
26 | }
|
27 |
|
28 | export default function registerRootComponent(component: ReactClass<{}>) {
|
29 | AppRegistry.registerComponent('main', () => wrapWithExponentRoot(component));
|
30 | }
|
31 |
|
\ | No newline at end of file |