Skip to content

Instantly share code, notes, and snippets.

@davidgilbertson
Created September 9, 2018 04:35
Show Gist options
  • Save davidgilbertson/a8ea2cf404819fd37e6c8eeba37e9be2 to your computer and use it in GitHub Desktop.
Save davidgilbertson/a8ea2cf404819fd37e6c8eeba37e9be2 to your computer and use it in GitHub Desktop.
import React from 'react';
import ReactDOM from 'react-dom';
import App from './App/App';
import './index.css';
const render = () => {
ReactDOM.render(<App />, document.getElementById('root'));
}
if (
'fetch' in window &&
'Intl' in window &&
'URL' in window &&
'Map' in window &&
'forEach' in NodeList.prototype &&
'startsWith' in String.prototype &&
'endsWith' in String.prototype &&
'includes' in String.prototype &&
'includes' in Array.prototype &&
'assign' in Object &&
'entries' in Object &&
'keys' in Object
) {
render();
} else {
import('./polyfills').then(render);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment