0

I'm trying to import multiple icons from the same pack at once, in this case, font-awesome like this:

import {FaPencilSquare,FaHome} from 'react-icons/fa'

but I'm getting this error:

ERROR in ./node_modules/react-icons/fa/index.js
Module build failed: SyntaxError: Unexpected token, expected { (1:7)

> 1 | export Fa500px from './500px';
    |        ^
  2 | export FaAdjust from './adjust';
  3 | export FaAdn from './adn';
  4 | export FaAlignCenter from './align-center';

If I import icons separately I don't get any errors, any ideas what it could be?

Brr Switch
  • 974
  • 1
  • 9
  • 21
pedrommuller
  • 15,741
  • 10
  • 76
  • 126
  • There is an [issue](https://github.com/gorangajic/react-icons/issues/99) that might be related to your question. I just saw it. – bennygenel Sep 19 '17 at 15:18

1 Answers1

4

Thanks to @bennygenel it seems like there is an open issue with that a workaround is to add the lib folder to your import like this:

import {FaHome,FaPencilSquare} from 'react-icons/lib/fa'
pedrommuller
  • 15,741
  • 10
  • 76
  • 126