Monday

import error >> using react-icons FaPencil

I try to install react-icons as following command:
             >> npm --loglevel info install --save react-icons

And try to use as follow:
import { FaPencil } from 'react-icons/fa'
import { FaTrash } from 'react-icons/fa'

...
 <button><FaPencil /></button>  
 <button><FaTrash /></button>

But I got following error:
Attempted import error: 'FaPencil' is not exported from 'react-icons/fa'.

FIX:
fa icons are free except for pencil. It needs pro license.
So you can use free version as follow:
import { FaPencilAlt } from 'react-icons/fa'
import { FaTrash } from 'react-icons/fa'

...
 <button><FaPencilAlt /></button>
 <button><FaTrash /></button>

No comments:

Post a Comment