Add babel polyfill to React Native Project

醉酒当歌 提交于 2019-12-05 11:01:46

In order to add babel-polyfill to your react-native project after installing

npm install --save babel-polyfill

just import it like this in your entry endpoint:

import 'babel-polyfill';

Now you can use new built-ins like Promise or WeakMap, static methods like Array.from and instance methods like Array.prototype.includes, etc.

You can use

npm install es6-symbol --save

Then add in your index.android.js & index.ios.js

import 'es6-symbol/implement'
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!