Skip to content

Commit 21f3d73

Browse files
Update intro.md
1 parent 616fdec commit 21f3d73

File tree

1 file changed

+0
-75
lines changed

1 file changed

+0
-75
lines changed

docusaurus/docs/intro.md

Lines changed: 0 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -112,81 +112,6 @@ We recommend Hermes with React Native >= 0.66 you won't need these polyfills at
112112

113113
:::
114114

115-
### Below React Native 0.66
116-
117-
You will need to add a polyfill for the Intl API on Android if:
118-
119-
- You have [Hermes](https://github.com/facebook/hermes/issues/23) enabled and are below React Native 0.66.
120-
- You have [Hermes](https://github.com/facebook/hermes/issues/23) disabled and you want to support locales outside of en-US and you don't have the org.webkit:android-jsc-intl:+ variant enabled in your `app/build.gradle`.
121-
122-
### Yarn Polyfills
123-
124-
```bash
125-
yarn add react-native-localize @formatjs/intl-pluralrules @formatjs/intl-getcanonicallocales @formatjs/intl-listformat @formatjs/intl-displaynames @formatjs/intl-locale @formatjs/intl-datetimeformat @formatjs/intl-numberformat @formatjs/intl-relativetimeformat
126-
```
127-
128-
### Npm Polyfills
129-
130-
```bash
131-
npm install react-native-localize @formatjs/intl-pluralrules @formatjs/intl-getcanonicallocales @formatjs/intl-listformat @formatjs/intl-displaynames @formatjs/intl-locale @formatjs/intl-datetimeformat @formatjs/intl-numberformat @formatjs/intl-relativetimeformat --save
132-
```
133-
134-
If using [Expo](https://docs.expo.dev/), omit `react-native-localize` and use `expo install expo-localization` instead. Read more [here](https://docs.expo.dev/versions/latest/sdk/localization/#installation).
135-
136-
In your app starting entrypoint e.g. `./index.js` or even better use a `index.android.js` to prevent importing on iOS/web add the following code.
137-
138-
:::info Note
139-
140-
Don't forget to import the languages you want to support, in the example only english language is supported.
141-
142-
:::
143-
144-
```javascript
145-
// on top of your index.android.js file
146-
const isAndroid = require('react-native').Platform.OS === 'android' // this line is only needed if you don't use an .android.js file
147-
const isHermesEnabled = !!global.HermesInternal // this line is only needed if you don't use an .android.js file
148-
149-
// in your index.js file
150-
if (isHermesEnabled || isAndroid) {
151-
// this line is only needed if you don't use an .android.js file
152-
153-
require('@formatjs/intl-getcanonicallocales/polyfill')
154-
require('@formatjs/intl-locale/polyfill')
155-
156-
require('@formatjs/intl-pluralrules/polyfill')
157-
require('@formatjs/intl-pluralrules/locale-data/en.js') // USE YOUR OWN LANGUAGE OR MULTIPLE IMPORTS YOU WANT TO SUPPORT
158-
159-
require('@formatjs/intl-displaynames/polyfill')
160-
require('@formatjs/intl-displaynames/locale-data/en.js') // USE YOUR OWN LANGUAGE OR MULTIPLE IMPORTS YOU WANT TO SUPPORT
161-
162-
require('@formatjs/intl-listformat/polyfill')
163-
require('@formatjs/intl-listformat/locale-data/en.js') // USE YOUR OWN LANGUAGE OR MULTIPLE IMPORTS YOU WANT TO SUPPORT
164-
165-
require('@formatjs/intl-numberformat/polyfill')
166-
require('@formatjs/intl-numberformat/locale-data/en.js') // USE YOUR OWN LANGUAGE OR MULTIPLE IMPORTS YOU WANT TO SUPPORT
167-
168-
require('@formatjs/intl-relativetimeformat/polyfill')
169-
require('@formatjs/intl-relativetimeformat/locale-data/en.js') // USE YOUR OWN LANGUAGE OR MULTIPLE IMPORTS YOU WANT TO SUPPORT
170-
171-
require('@formatjs/intl-datetimeformat/polyfill')
172-
require('@formatjs/intl-datetimeformat/locale-data/en.js') // USE YOUR OWN LANGUAGE OR MULTIPLE IMPORTS YOU WANT TO SUPPORT
173-
174-
require('@formatjs/intl-datetimeformat/add-golden-tz.js')
175-
176-
// https://formatjs.io/docs/polyfills/intl-datetimeformat/#default-timezone
177-
if ('__setDefaultTimeZone' in Intl.DateTimeFormat) {
178-
// If you are using react-native-cli
179-
let RNLocalize = require('react-native-localize')
180-
Intl.DateTimeFormat.__setDefaultTimeZone(RNLocalize.getTimeZone())
181-
182-
// Are you using Expo, use this instead of previous 2 lines
183-
// Intl.DateTimeFormat.__setDefaultTimeZone(
184-
// require("expo-localization").timezone
185-
// );
186-
}
187-
} // this line is only needed if you don't use an .android.js file
188-
```
189-
190115
## Tips & Tricks
191116

192117
- Use 0.14+ version of React-Native-Web (Modal and better number input)

0 commit comments

Comments
 (0)