Preload custom fonts in React

  1. Link types: preload — HTML: HyperText Markup Language
  2. Web Font Loader

Web Font Loader

useEffect(() => {  WebFont.load({    custom: {      families: FONTS_FAMILY_NAMES,      urls: ['../assets/fonts/stylesheet.css'],    },  });}, []);




Web developer

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Javascript Client-side storage, Error, Navigator and Classes

#095 | Simulating An Epidemic Outbreak With JavaScript — Part 5

Making an Angular project mono repo with NgRx state management and lazy-loading.

Choose The Approach for Building a Responsive Web App

How GitHub Copilot will Change Developers Life

React: From “Class” Components to Hooks

Charting with React using JQWidgets

Why now is the right time to dive into native iOS for the React engineer

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Asher Yang

Asher Yang

Web developer

More from Medium

Infinite scroll using IntersectionObserver API and Ant Design List component in ReactTs

Voice Effects using Pizzicato.js with Agora RTC in a React JS App

Day 3: Accessible Rich Internet Applications (WAI-ARIA)

How to style React