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: README.md
+12-11Lines changed: 12 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,6 @@
1
1
# Openmoji for React
2
2
3
-
unofficial; bodged by drinking-code
4
-
not optimized for production use
3
+
unofficial; bodged by drinking-code
5
4
6
5
1.[What is Openmoji for React?](#what-is-openmoji-for-react)
7
6
2.[Installation](#installation)
@@ -69,7 +68,7 @@ export default App;
69
68
70
69
#### `replaceEmojis(string[, options])`
71
70
72
-
Is the sting equivalent to `reactReplaceEmojis`. Use this if you only want to replace emojis within a string.
71
+
Is the string equivalent to `reactReplaceEmojis`. Use this if you just want to replace emojis within a string.
73
72
74
73
```jsx
75
74
importReactfrom'react';
@@ -97,15 +96,15 @@ const App = () => {
97
96
exportdefaultApp;
98
97
```
99
98
100
-
Icon names from the [Openmoji Library](https://openmoji.org/library/) are converted into camelCase,
99
+
Icon names from the [Openmoji Library](https://openmoji.org/library/) are converted into PascalCase,
101
100
so `man raising hand` translates to `ManRaisingHand`.
102
101
103
102
##### Additions
104
103
105
-
`:`are replaced with `_`.
104
+
`:`is replaced with `_`.
106
105
107
106
```
108
-
waving hand: light skin tone -> WavingHand_LightSkinTone
107
+
waving hand: light skin tone -> WavingHand_LightSkinTone
109
108
```
110
109
111
110
`,`, `.`, `’`, `!`, `”`, and `&` are removed.
@@ -122,8 +121,8 @@ flag: Bosnia & Herzegovina -> Flag_BosniaHerzegovina
122
121
`#` is replaced with `NumberSign`, `*` is replaced with `Asterisk`.
123
122
124
123
```
125
-
keycap: # -> Keycap_NumberSign
126
-
keycap: * -> Keycap_Asterisk
124
+
keycap: # -> Keycap_NumberSign
125
+
keycap: * -> Keycap_Asterisk
127
126
```
128
127
129
128
Everything in brackets is removed.
@@ -138,9 +137,11 @@ If a name starts with a number, a `_` is added in front of the name.
138
137
1st place medal -> _1stPlaceMedal
139
138
```
140
139
140
+
> **Note:** Some names may appear more than once in the Library (i.e. some emoji variations). Those duplicates are renamed to `DuplicatedName2`, `DuplicatedName3` etc.
141
+
141
142
#### Via unicode
142
143
143
-
You can use the unicode of the emoji to import it. Unicodes are listed also in
144
+
You can use the unicode of the emoji to import it. Unicodes are also listed in
144
145
the [Openmoji Library](https://openmoji.org/library/). All unicode names have the `U_` prefix in `react-openmoji`.
145
146
146
147
```jsx
@@ -154,7 +155,7 @@ const App = () => {
154
155
exportdefaultApp;
155
156
```
156
157
157
-
You can also include all 3914 emojis:
158
+
> **Fun fact:** Importing all 3914 emojis at once is actually just as fast as the other methods because all emojis are dynamically loaded:
158
159
159
160
```jsx
160
161
importReactfrom'react';
@@ -169,7 +170,7 @@ export default App;
169
170
170
171
#### Attributes
171
172
172
-
In all manual cases you can use two attributes:
173
+
With all manual methods you can use two attributes:
0 commit comments