Skip to content

Commit d40dfb2

Browse files
authored
Merge pull request #10 from entria/refactor/Usage
improve usage to avoid mistakes
2 parents 7dae5f9 + 4655bd3 commit d40dfb2

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

Icon.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class Icon extends Component {
1616
style={[styles.icon, { color }, style]}
1717
ref={component => this._root = component}
1818
>
19-
{Icons[children]}
19+
{children}
2020
</Text>
2121
);
2222
}

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,15 @@ Follow this guides for adding FontAwesome.ttf to your projects:
3232

3333
# Usage
3434
```javascript
35-
import FontAwesome from 'react-native-fontawesome';
35+
import FontAwesome, { Icons } from 'react-native-fontawesome';
3636

3737
...
3838
render() {
3939
return (
4040
<View>
4141
<TouchableHighlight>
4242
<Text style={{margin: 10, fontSize: 15, textAlign: 'left'}}>
43-
<FontAwesome> key</FontAwesome>
43+
<FontAwesome>{Icons.chevronLeft}</FontAwesome>
4444
Text
4545
</Text>
4646
</TouchableHighlight>
@@ -58,6 +58,6 @@ Example: `th-large` becomes `thLarge`
5858
# Why this is fast, and uses almost no extra memory
5959
This package uses the Text element to render Icons. The Text element delegates
6060
to the OS the render process of the icons based on the Font file.
61-
Both IOS and Android render fonts amazingly fast with little memory overhead. In essence
61+
Both IOS and Android render fonts amazingly fast with little memory overhead. In essence
6262
FontAwesome.ttf will be used by the OS to render icons and will benefit of years
6363
of native software improvement as well hardware acceleration.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "react-native-fontawesome",
33
"description": "Font Awesome Icons for React Native",
4-
"version": "4.7.0",
4+
"version": "5.7.0",
55
"author": "Rafael Turk",
66
"bugs": {
77
"url": "https://github.com/rturk/react-native-fontawesome/issues"

0 commit comments

Comments
 (0)