зеркало из https://github.com/microsoft/rnx-kit.git
57013d2191
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Tommy Nguyen <4123478+tido64@users.noreply.github.com> |
||
---|---|---|
.. | ||
src | ||
test | ||
CHANGELOG.md | ||
README.md | ||
eslint.config.js | ||
package.json | ||
tsconfig.json |
README.md
@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 --dev
or if you're using npm
npm add --save-dev @rnx-kit/polyfills
Usage
-
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