File tree Expand file tree Collapse file tree 2 files changed +25
-0
lines changed Expand file tree Collapse file tree 2 files changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ import React from 'react';
2
2
import ReactDOM from 'react-dom' ;
3
3
import App from './App' ;
4
4
// import registerServiceWorker from './registerServiceWorker';
5
+ import './polyfill'
5
6
6
7
ReactDOM . render ( < App /> , document . querySelector ( '#demo' ) )
7
8
// ReactDOM.render(<App />, document.getElementById('root'));
Original file line number Diff line number Diff line change
1
+ // IE11 polyfills
2
+
3
+ if ( ! Array . prototype . find ) {
4
+ Array . prototype . find = function ( predicate ) {
5
+ if ( this == null ) {
6
+ throw new TypeError ( 'Array.prototype.find called on null or undefined' ) ;
7
+ }
8
+ if ( typeof predicate !== 'function' ) {
9
+ throw new TypeError ( 'predicate must be a function' ) ;
10
+ }
11
+ const list = Object ( this ) ;
12
+ const length = list . length >>> 0 ;
13
+ const thisArg = arguments [ 1 ] ;
14
+ let value ;
15
+
16
+ for ( let i = 0 ; i < length ; i ++ ) {
17
+ value = list [ i ] ;
18
+ if ( predicate . call ( thisArg , value , i , list ) ) {
19
+ return value ;
20
+ }
21
+ }
22
+ return undefined ;
23
+ } ;
24
+ }
You can’t perform that action at this time.
0 commit comments