You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/Getting-Started.md
+3-3
Original file line number
Diff line number
Diff line change
@@ -62,7 +62,7 @@ If you need to support older browsers, we recommend you do the following:
62
62
2. Polyfill `Intl.DateTimeFormat` with https://github.com/formatjs/date-time-format-timezone
63
63
3. If you're supporting browsers that do not have [Intl.PluralRules](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/PluralRules) (e.g IE11 & Safari 12-), include this [polyfill](https://www.npmjs.com/package/@formatjs/intl-pluralrules) in your build.
64
64
65
-
```js
65
+
```tsx
66
66
if (!Intl.PluralRules) {
67
67
require('@formatjs/intl-pluralrules/polyfill');
68
68
require('@formatjs/intl-pluralrules/dist/locale-data/de'); // Add locale data for de
@@ -71,7 +71,7 @@ if (!Intl.PluralRules) {
71
71
72
72
4. If you're supporting browsers that do not have [Intl.RelativeTimeFormat](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RelativeTimeFormat) (e.g IE11, Edge, Safari 12-), include this [polyfill](https://www.npmjs.com/package/@formatjs/intl-relativetimeformat) in your build along with individual CLDR data for each locale you support.
@@ -131,7 +131,7 @@ Shallow rendering only tests one level deep and we want to test the rendering of
131
131
132
132
Under the hood, `injectIntl()` passes `context.intl` which was created from the `<IntlProvider>` in the component's ancestry to `props.intl`. What we need to do is simulate this for our shallow rendering test:
@@ -49,7 +49,7 @@ if ('ReactIntl' in window && 'ReactIntlLocaleData' in window) {
49
49
50
50
**Using Browserify/Webpack to Load React Intl:**
51
51
52
-
```js
52
+
```tsx
53
53
import {addLocaleData} from'react-intl';
54
54
55
55
if ('ReactIntlLocaleData'inwindow) {
@@ -69,7 +69,7 @@ if ('ReactIntlLocaleData' in window) {
69
69
70
70
In React Intl v1, you would add the `IntlMixin` to your root component; e.g., `<App>`. Remove the `IntlMixin` and instead wrap your root component with [`<IntlProvider>`](Components#intlprovider):
71
71
72
-
```js
72
+
```tsx
73
73
importReactDOMfrom'react-dom';
74
74
import {IntlProvider} from'react-intl';
75
75
@@ -89,7 +89,7 @@ The `IntlMixin` also provided the imperative API for custom components to use th
89
89
90
90
Here's an example of a custom `<RelativeTime>` stateless component which uses `injectIntl()` and the imperative [`formatDate()`](API.md#formatdate) API:
Copy file name to clipboardExpand all lines: docs/Upgrade-Guide.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -152,7 +152,7 @@ If you previously were using `addLocaleData` to support older browsers, we recom
152
152
1. If you're supporting browsers that do not have [Intl.PluralRules](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/PluralRules) (e.g IE11 & Safari 12-), include this [polyfill](https://www.npmjs.com/package/@formatjs/intl-pluralrules) in your build.
153
153
2. If you're supporting browsers that do not have [Intl.RelativeTimeFormat](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RelativeTimeFormat) (e.g IE11, Edge, Safari 13-), include this [polyfill](https://www.npmjs.com/package/@formatjs/intl-relativetimeformat) in your build along with individual CLDR data for each locale you support.
154
154
155
-
```js
155
+
```tsx
156
156
if (!Intl.PluralRules) {
157
157
require('@formatjs/intl-pluralrules/polyfill');
158
158
require('@formatjs/intl-pluralrules/dist/locale-data/de'); // Add locale data for de
0 commit comments