Satisfying space in a React / Redux application (created with create-react-app) is the best place to place / place any files that will serve as custom polyfiles for browsers that lack support. In particular, I need to be able to use Array.prototype.includesand String.prototype.startsWith, as well as several other methods that are not supported in Internet Explorer or Microsoft Edge. Any suggestions are welcome!
create-react-app
Array.prototype.includes
String.prototype.startsWith
After ejectyour React / Redux application (created using create-react-app), you should find the folder polyfills.jsin /config.
eject
polyfills.js
/config
You can then add your polyfill codes or use the ones offered by the Mozilla Developer Network:
Array.prototype.includes ()
String.prototype.startsWith ()
Hope the above helps.
If you use core-js , it will be installed using npm, and the code will be in the folder node_modules.
node_modules
You can import it from the application entry point:
require('core-js')
index.js , !
index.js
import 'core-js/es6/'; import React from 'react'; import ReactDOM from 'react-dom'; import App from './app'; ReactDOM.render(<App />, document.getElementById('root'));
Source: https://habr.com/ru/post/1676791/More articles:UWP binding on VisualState networks - c #VSTS build Copy copies the full path to the destination - vsts-buildError CS0649 in C # - c #EF using skip and execute stored procedure - c #How to wait inside an RxJS subscription method - angularHow to install and run Docker CE on OpenSUSE Linux? - linuxThe difference between heartbeat.interval.ms and session.timeout.ms in Kafka user configuration - apache-kafkaCopy to output directory in Visual Studio 2017 - c #How does Haskell instantly calculate this huge amount? - haskellAttempting to access the Google Directory API via p12 does not resolve an authorized error - python-2.7All Articles