-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
31 lines (26 loc) · 837 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import {AppRegistry} from 'react-native';
import Index from './src/index';
import appName from './app.json';
// Generate required css
import iconFont from 'react-native-vector-icons/Fonts/FontAwesome.ttf';
const iconFontStyles = `@font-face {
src: url(${iconFont});
font-family: FontAwesome;
}`;
AppRegistry.registerComponent(appName.name, () => Index);
// Run application on web
if (typeof document !== 'undefined') {
// Create stylesheet
const style = document.createElement('style');
style.type = 'text/css';
if (style.styleSheet) {
style.styleSheet.cssText = iconFontStyles;
} else {
style.appendChild(document.createTextNode(iconFontStyles));
}
// Inject stylesheet
document.head.appendChild(style);
AppRegistry.runApplication(appName.name, {
rootTag: document.getElementById('root'),
});
}