Forked from davidgilbertson/index-sometimes-poly.js
Created
September 20, 2018 14:15
-
-
Save juandc/1e1353f673c9c0d83b2a0883f1793d1d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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