Closed Simoneth closed 2 years ago
Are you sure you are using the selection.json
file that came with the font when you downloaded it?
Soon there will be an easier way to generate this file outside of icomoon.
Are you sure you are using the
selection.json
file that came with the font when you downloaded it?Soon there will be an easier way to generate this file outside of icomoon.
Yes, I'm a React developer and I did everything as documented here.
Can you share the contents of your selection.json
file?
Here we go:
{
"IcoMoonType": "selection",
"icons": [
{
"icon": {
"paths": [
"M864 0c88.364 0 160 71.634 160 160 0 36.020-11.91 69.258-32 96l-64 64-224-224 64-64c26.742-20.090 59.978-32 96-32zM64 736l-64 288 288-64 592-592-224-224-592 592zM715.578 363.578l-448 448-55.156-55.156 448-448 55.156 55.156z"
],
"isMulticolor": false,
"isMulticolor2": false,
"tags": [
"pencil"
],
"defaultCode": 59656,
"grid": 0
},
"properties": {
"id": 9,
"order": 84,
"ligatures": "write, pencil",
"prevSize": 32,
"code": 59656,
"name": "pencil"
},
"setIdx": 0,
"setId": 3,
"iconIdx": 8
},
// ...
],
"height": 1024,
"metadata": {
"name": "icomoon"
},
"preferences": {
// ...
}
}
In the meantime I tried to load another set of icons, without imported custom icons like the above, and everything works fine.
Thanks @Simoneth. You can use react-icomoon@2.5.1
version. Problem solved.
Hi, I downloaded my selection.json and inserted it correctly in path, there is a "pencil" named icon in it. So I used
<Icon icon="pencil" size={20} color="orange" />
and got this:"react": "17.0.2", "react-scripts": "4.0.3"