Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
13138449
Jumping Panda
Commits
e63cf025
Commit
e63cf025
authored
Oct 30, 2020
by
13138449
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Upload New File
parent
299600d0
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
0 deletions
+22
-0
config/polyfills.js
config/polyfills.js
+22
-0
No files found.
config/polyfills.js
0 → 100644
View file @
e63cf025
'
use strict
'
;
if
(
typeof
Promise
===
'
undefined
'
)
{
// Rejection tracking prevents a common issue where React gets into an
// inconsistent state due to an error, but it gets swallowed by a Promise,
// and the user has no idea what causes React's erratic future behavior.
require
(
'
promise/lib/rejection-tracking
'
).
enable
();
window
.
Promise
=
require
(
'
promise/lib/es6-extensions.js
'
);
}
// fetch() polyfill for making API calls.
require
(
'
whatwg-fetch
'
);
// Object.assign() is commonly used with React.
// It will use the native implementation if it's present and isn't buggy.
Object
.
assign
=
require
(
'
object-assign
'
);
// In tests, polyfill requestAnimationFrame since jsdom doesn't provide it yet.
// We don't polyfill it in the browser--this is user's responsibility.
if
(
process
.
env
.
NODE_ENV
===
'
test
'
)
{
require
(
'
raf
'
).
polyfill
(
global
);
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment