Skip to content

Instantly share code, notes, and snippets.

@haruelrovix

haruelrovix/index.js

Created Dec 10, 2018
Embed
What would you like to do?
RNW x RNE: RNVI works like a charm with RNW!
import React from 'react';
import ReactDOM from 'react-dom';
// Generate required css
import iconFont from 'react-native-vector-icons/Fonts/FontAwesome.ttf';
import './index.css';
import App from './App';
import registerServiceWorker from './registerServiceWorker';
// https://github.com/oblador/react-native-vector-icons#web-with-webpack
const iconFontStyles = `@font-face {
src: url(${iconFont});
font-family: FontAwesome;
}`;
// 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);
ReactDOM.render(<App />, document.getElementById('root'));
registerServiceWorker();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.