Tapas Adhikary
Educator @tapaScript | Founder CreoWis & ReactPlay - Writer - YouTuber - Open Source
In HTML, font is used to specify the font face, size, and typography. You can add fonts to your React application in different ways. This article explains three quick ways of adding fonts to your React app. All the examples in the article assumes th...
blog.greenroots.info5 min read
Tapas Adhikary
Educator @tapaScript | Founder CreoWis & ReactPlay - Writer - YouTuber - Open Source
Hi, The content is written perfectly to solve the exact solutions that I needed. Congrats Tapas Adhikary π
I tried importing the exact way you mentioned to import into the index.js file, and still returns an error not found when the path matches.
import './assets/fonts/AvenirNextLTPro-Regular.otf';
in /src/index.js
Module not found: Error: Can't resolve './assets/fonts/AvenirNextLTPro-regular.otf' in 'MyPathToTheProject/src'
Great tactics mate! This was much quicker than watching a 5-minute youtube video, thank you.
Sweet and simple! I use @font-face most often but nice to know the other quick alternatives :D
Shobhit Sharma
Thank you so much, Keep Writing such use cases on React :)