GithubHelp home page GithubHelp logo

johanneslumpe / react-native-browser-polyfill Goto Github PK

View Code? Open in Web Editor NEW
32.0 4.0 3.0 3 KB

A collection of polyfills for the react-native JavaScript environment.

License: MIT License

JavaScript 100.00%

react-native-browser-polyfill's Introduction

react-native-browser-polyfill

A collection of polyfills for the react-native JavaScript environment.

If polyfills are needed to make browser-targeted libraries, which use commonly available functions/variables, work in react-native, this is the place to put them. Issues/PRs welcome.

Usage

npm install react-native-browser-polyfill the package and then require('react-native-browser-polyfill') it in your main entry file, before any libraries which require the polyfills.

Polyfills available in this package

global.self

Currently JavaScriptCore does not provide a self reference to the global object, which is utilized by browser libraries (i.e bluebird) to have a reliably reference to the global object which works in browsers and web-workers alike.

react-native-browser-polyfill's People

Contributors

johanneslumpe avatar tqc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

bradparks tqc

react-native-browser-polyfill's Issues

ES6/TS project should use import syntax not require

Finding that contrary to the README, just using require('react-native-browser-polyfill') is insufficient if it is followed by import statements (order of precedence?) in an ES6 project (mine is TypeScript with React Native).

The solution for me was:

import 'react-native-browser-polyfill'

as the first line in my main index file for the application. If others share this experience, perhaps it should be mentioned in the README?

ps. Thanks for the fix, was getting the dreaded self is not defined, but strangely it was only when debugging via VS Code React Native tools

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.