I am running in to trouble trying to add Google Fonts in to my React Application, Does anyone know the easiest way to do this?
Asked
Active
Viewed 8,006 times
2 Answers
3
You can import it like this
<style>
@import url('https://fonts.googleapis.com/css?family=Roboto&display=swap');
</style>
Within the <head>
tag in your index.html file
Hope this helps.

Shmili Breuer
- 3,927
- 2
- 17
- 26
0
If you want to make it available across your whole application, you can simply include a stylesheet tag in your index.html
<link href="https://fonts.googleapis.com/css?family=Roboto&display=swap" rel="stylesheet">
Then you can simply style your component
const Komponent = () => (
<h1 style={{ fontFamily: 'Roboto' }}> Styled Text </h1>
);

Cody Elhard
- 655
- 1
- 7
- 17