Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Font awesome icon doesn't work with React #92

Closed
josesaranda opened this issue Aug 22, 2019 · 6 comments
Closed

Font awesome icon doesn't work with React #92

josesaranda opened this issue Aug 22, 2019 · 6 comments

Comments

@josesaranda
Copy link

I have a React application. To enable Font Awesome icon i added, before use L.easyButton, import 'font-awesome/css/font-awesome.min.css'; but it doesn't work.

It seems to be an incompatibility of Font Awesome with React. Did you try to use your library with React?

@atstp
Copy link
Contributor

atstp commented Aug 27, 2019

could you share a bit more about your situation?

some good stuff to see would be:

  • explanations of your attempts to solve this on your own
  • the exact error messages you're seeing
  • a minimal, running example that shows your error (see here)
  • the versions of the various libraries you're using

@josesaranda
Copy link
Author

Thanks for your reply. This was exactly what i did:

...

import * as L from 'leaflet';
import 'leaflet-draw';
import 'leaflet-draw/dist/leaflet.draw.css';
import 'leaflet-draw/dist/leaflet.draw-src.css';
import 'leaflet-easybutton';
import 'leaflet-easybutton/src/easy-button.css';

...

L.easyButton('fa-trash',() => {
            // clear layer on new layer
            this.clearLayer(map);
}).addTo(map);

But it shows like corrupted icon.

@atstp
Copy link
Contributor

atstp commented Aug 27, 2019

is font awesome installed and imported?

@josesaranda
Copy link
Author

Yes and yes

@atstp
Copy link
Contributor

atstp commented Aug 28, 2019

gotcha.

Did you check the existing issues?

there's this one that mentions some issues with recent versions of Font Awesome. Does that issue line up with your experience?

@josesaranda
Copy link
Author

Yes is the same issue!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants