@rnx-kit/polyfills
v0.2.0
Published
EXPERIMENTAL - USE WITH CAUTION - New package called polyfills
Keywords
Readme
@rnx-kit/polyfills
🚧🚧🚧🚧🚧🚧🚧🚧🚧🚧🚧
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 --devor if you're using npm
npm add --save-dev @rnx-kit/polyfillsUsage
Add the Babel plugin:
// babel.config.js module.exports = { presets: ["module:@react-native/babel-preset"], + plugins: [require("@rnx-kit/polyfills")], };In your
index.ts(orindex.js), add the following comment at the top of the file:// @react-native-webapis
