@rnx-kit/polyfills
TypeScript icon, indicating that this package has built-in type declarations

0.1.1 • Public • Published

@rnx-kit/polyfills

Build npm version

🚧🚧🚧🚧🚧🚧🚧🚧🚧🚧🚧

THIS TOOL IS EXPERIMENTAL — USE WITH CAUTION

🚧🚧🚧🚧🚧🚧🚧🚧🚧🚧🚧

This is a polyfills "autolinker" for React Native. It works like native module autolinking, but gathers polyfills from dependencies instead.

Motivation

Please read the Modularity section of the React Native WebAPIs RFC for its raison d'être.

Installation

yarn add @rnx-kit/polyfills --dev

or if you're using npm

npm add --save-dev @rnx-kit/polyfills

Usage

  1. Add the Babel plugin:

     // babel.config.js
     module.exports = {
       presets: ["module:@react-native/babel-preset"],
    +  plugins: [require("@rnx-kit/polyfills")],
     };
  2. In your index.ts (or index.js), add the following comment at the top of the file:

    // @react-native-webapis
    

Readme

Keywords

none

Package Sidebar

Install

npm i @rnx-kit/polyfills

Weekly Downloads

9

Version

0.1.1

License

MIT

Unpacked Size

12.6 kB

Total Files

14

Last publish

Collaborators

  • kelset
  • hansenyy
  • jasonvmorse
  • acoates
  • rnbot
  • tido64
  • rnsdkbot