Skip to content

Commit 6d61a5b

Browse files
authored
docs: update all docs to default to using the named export (#1813)
1 parent a8d032f commit 6d61a5b

File tree

25 files changed

+106
-104
lines changed

25 files changed

+106
-104
lines changed

MIGRATION.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ Update your import statements to use the new library names
5353
import Fontisto from "react-native-vector-icons";
5454

5555
// New
56-
import Fontisto from "@react-native-vector-icons/fontisto";
56+
import { Fontisto } from "@react-native-vector-icons/fontisto";
5757
```
5858

5959
### Move to new props for Fontawesome 5 and 6

README.md

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,9 @@ For fonts like fontawesome6-pro, fontello and icomoon where you provide the font
106106
You can either use one of the bundled icons above or roll your own custom font.
107107

108108
```js
109-
import Icon from "@react-native-vector-icons/fontawesome";
109+
import { FontAwesome } from "@react-native-vector-icons/fontawesome";
110110

111-
<Icon name="rocket" size={30} color="#900" />;
111+
<FontAwesome name="rocket" size={30} color="#900" />;
112112
```
113113

114114
### Props
@@ -144,13 +144,13 @@ By combining some of these you can create for example :
144144
Some fonts today use multiple styles, FontAwesome 6 for example, which is supported by this library. The usage is pretty much the same as the standard `Icon` component:
145145

146146
```jsx
147-
import Icon from "@react-native-vector-icons/fontawesome5";
147+
import { FontAwesome5 } from "@react-native-vector-icons/fontawesome5";
148148

149-
<Icon name="comments" size={30} color="#900" />; // Defaults to regular
149+
<FontAwesome5 name="comments" size={30} color="#900" />; // Defaults to regular
150150

151-
<Icon name="comments" size={30} color="#900" iconType="solid" />
151+
<FontAwesome5 name="comments" size={30} color="#900" iconType="solid" />
152152

153-
<Icon name="comments" size={30} color="#900" iconType="light" />
153+
<FontAwesome5 name="comments" size={30} color="#900" iconType="light" />
154154
```
155155

156156
## Usage as PNG Image/Source Object
@@ -243,20 +243,22 @@ Try the `IconExplorer` project in `Examples/IconExplorer` folder, there you can
243243
### Basic Example
244244

245245
```js
246-
import Icon from "@react-native-vector-icons/ionicons";
246+
import { IonIcons } from "@react-native-vector-icons/ionicons";
247247

248-
const ExampleView = () => <Icon name="ios-person" size={30} color="#4F8EF7" />;
248+
const ExampleView = () => (
249+
<IonIcon name="ios-person" size={30} color="#4F8EF7" />
250+
);
249251
```
250252

251253
### Inline Icons
252254

253255
```js
254256
import { Text } from "react-native";
255-
import Icon from "@react-native-vector-icons/ionicons";
257+
import { IonIcons } from "@react-native-vector-icons/ionicons";
256258

257259
const ExampleView = (props) => (
258260
<Text>
259-
Lorem <Icon name="ios-book" color="#4F8EF7" /> Ipsum
261+
Lorem <IonIcon name="ios-book" color="#4F8EF7" /> Ipsum
260262
</Text>
261263
);
262264
```

packages/ant-design/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ npm install @react-native-vector-icons/ant-design
1212

1313
## Usage
1414

15-
```js
16-
import AntDesign from '@react-native-vector-icons/ant-design';
15+
```jsx
16+
import { AntDesign } from '@react-native-vector-icons/ant-design';
1717

1818
// ...
1919

packages/entypo/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ npm install @react-native-vector-icons/entypo
1212

1313
## Usage
1414

15-
```js
16-
import Entypo from '@react-native-vector-icons/entypo';
15+
```jsx
16+
import { Entypo } from '@react-native-vector-icons/entypo';
1717

1818
// ...
1919

packages/evil-icons/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ npm install @react-native-vector-icons/evil-icons
1212

1313
## Usage
1414

15-
```js
16-
import EvilIcons from '@react-native-vector-icons/evil-icons';
15+
```jsx
16+
import { EvilIcons } from '@react-native-vector-icons/evil-icons';
1717

1818
// ...
1919

packages/feather/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ npm install @react-native-vector-icons/feather
1212

1313
## Usage
1414

15-
```js
16-
import Feather from '@react-native-vector-icons/feather';
15+
```jsx
16+
import { Feather } from '@react-native-vector-icons/feather';
1717

1818
// ...
1919

packages/fontawesome/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ npm install @react-native-vector-icons/fontawesome
1212

1313
## Usage
1414

15-
```js
16-
import FontAwesome from '@react-native-vector-icons/fontawesome';
15+
```jsx
16+
import { FontAwesome } from '@react-native-vector-icons/fontawesome';
1717

1818
// ...
1919

packages/fontawesome5-pro/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ All you really need to do is adding the Pro fonts to the `rnvi-fonts/fontawesome
2020
Using the standard icons works just like the standard icons in this library.
2121

2222
```javascript
23-
import FontAwesome5Pro from "@react-native-vector-icons/fontawesome5-pro";
23+
import { FontAwesome5Pro } from "@react-native-vector-icons/fontawesome5-pro";
2424

2525
const icon = <FontAwesome5Pro name="comments" />;
2626
```
@@ -29,7 +29,7 @@ Something special about the FontAwesome5Pro class is that you can also pass prop
2929
to change the style of the icon:
3030

3131
```javascript
32-
import FontAwesome5Pro from "@react-native-vector-icons/fontawesome5-pro";
32+
import { FontAwesome5Pro } from "@react-native-vector-icons/fontawesome5-pro";
3333

3434
const icon = <FontAwesome5Pro name="comments" iconStyle="solid" />;
3535
const icon = <FontAwesome5Pro name="git" iconStyle="brand" />;
@@ -56,7 +56,7 @@ style is required.
5656
Use this to select which style the generated image should have:
5757

5858
```javascript
59-
import FontAwesome5Pro from "@react-native-vector-icons/fontawesome5-pro";
59+
import { FontAwesome5Pro } from "@react-native-vector-icons/fontawesome5-pro";
6060

6161
FontAwesome5Pro.getImageSource("solid", "comments", 30, "#000").then((source) =>
6262
this.setState({ image: source }),

packages/fontawesome5/README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
Using the standard icons works just like the standard icons in this library.
1111

1212
```javascript
13-
import FontAwesome5 from '@react-native-vector-icons/fontawesome5';
13+
import { FontAwesome5 } from "@react-native-vector-icons/fontawesome5";
1414

1515
const icon = <FontAwesome5 name="comments" />;
1616
```
@@ -19,15 +19,15 @@ Something special about the FontAwesome5 class is that you can also pass props
1919
to change the style of the icon:
2020

2121
```javascript
22-
import FontAwesome5 from '@react-native-vector-icons/fontawesome5';
22+
import { FontAwesome5 } from "@react-native-vector-icons/fontawesome5";
2323

2424
const icon = <FontAwesome5 name="comments" iconStyle="solid" />;
2525
const icon = <FontAwesome5 name="git" iconStyle="brand" />;
2626
```
2727

2828
**Valid types**
2929

30-
| Type | Description |
30+
| Type | Description |
3131
| ----------- | --------------------- |
3232
| **regular** | Uses the Regular font |
3333
| **brand** | Uses the Brands font |
@@ -44,10 +44,10 @@ style is required.
4444
Use this to select which style the generated image should have:
4545

4646
```javascript
47-
import FontAwesome5 from '@react-native-vector-icons/fontawesome5';
47+
import { FontAwesome5 } from "@react-native-vector-icons/fontawesome5";
4848

49-
FontAwesome5.getImageSource('solid', 'comments', 30, '#000').then(
50-
(source) => this.setState({ image: source })
49+
FontAwesome5.getImageSource("solid", "comments", 30, "#000").then((source) =>
50+
this.setState({ image: source }),
5151
);
5252
```
5353

packages/fontawesome6-pro/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ All you really need to do is adding the Pro fonts to the `rnvi-fonts/fontawesome
2020
Using the standard icons works just like the standard icons in this library.
2121

2222
```javascript
23-
import FontAwesome6Pro from "@react-native-vector-icons/fontawesome6-pro";
23+
import { FontAwesome6Pro } from "@react-native-vector-icons/fontawesome6-pro";
2424

2525
const icon = <FontAwesome6Pro name="comments" />;
2626
```
@@ -29,7 +29,7 @@ Something special about the FontAwesome6Pro class is that you can also pass prop
2929
to change the style of the icon:
3030

3131
```javascript
32-
import FontAwesome6Pro from "@react-native-vector-icons/fontawesome6-pro";
32+
import { FontAwesome6Pro } from "@react-native-vector-icons/fontawesome6-pro";
3333

3434
const icon = <FontAwesome6Pro name="comments" iconStyle="solid" />;
3535
const icon = <FontAwesome6Pro name="git" iconStyle="brand" />;
@@ -60,7 +60,7 @@ style is required.
6060
Use this to select which style the generated image should have:
6161

6262
```javascript
63-
import FontAwesome6Pro from "@react-native-vector-icons/fontawesome6-pro";
63+
import { FontAwesome6Pro } from "@react-native-vector-icons/fontawesome6-pro";
6464

6565
FontAwesome6Pro.getImageSource("solid", "comments", 30, "#000").then((source) =>
6666
this.setState({ image: source }),

0 commit comments

Comments
 (0)