Skip to content

Instantly share code, notes, and snippets.

@haruelrovix
Created December 10, 2018 02:20
Show Gist options
  • Save haruelrovix/b291e8a4f34577d94e85570d304b82fe to your computer and use it in GitHub Desktop.
Save haruelrovix/b291e8a4f34577d94e85570d304b82fe to your computer and use it in GitHub Desktop.
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