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
Apps bootstrapped with [`create-react-app`](https://github.com/facebookincubator/create-react-app) support this module out of the box, remember to set `useCssModules` to `false` (unfortunately `create-react-app` does not currently support Css modules).
35
-
36
-
```js
37
-
// @flow
38
-
import*asReactfrom'react';
39
-
importFlagIconFactoryfrom'react-flag-icon-css'
40
-
41
-
// Please only use `FlagIconFactory` one time in your application, there is no
42
-
// need to use it multiple times (it would slow down your app). You may place the
43
-
// line below in a `FlagIcon.js` file in your 'components' directory, then
44
-
// write `export default FlagIcon` after it and import it everywhere in your app.
Apps bootstrapped with [`create-react-app`](https://github.com/facebookincubator/create-react-app) support this module out of the box, just follow the [Basic Usage](#basic-usage) example and remember to set `useCssModules` to `false` (unfortunately `create-react-app`[does not currently](https://github.com/facebookincubator/create-react-app/pull/2285) support Css modules).
48
35
49
36
## Prerequisites for *custom* apps
50
37
@@ -64,18 +51,18 @@ $ npm install --save-dev ...
64
51
65
52
## Basic usage
66
53
67
-
Import `FlagIconFactory` from `react-flag-icon-css`, it accepts the `React` module as the first argument and creates the `FlagIcon` component.*This approach ensures that `FlagIcon` uses your app's `React` instance, avoiding issues such as two versions of `React` being loaded at the same time.*
54
+
Import `FlagIconFactory` from `react-flag-icon-css`, it accepts the `React` module as the first argument and creates the `FlagIcon` component (remove the *@flow* comment if you don't use `Flow`, it does not have any effect). *This approach ensures that `FlagIcon` uses your app's `React` instance, avoiding issues such as two versions of `React` being loaded at the same time.*
0 commit comments