Skip to content

Commit 29ab43c

Browse files
author
Adrian Bece
committed
Fixed loading issue when no options are present & fix docs
1 parent 2d22ba6 commit 29ab43c

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
Performant asynchronous font loading plugin for Gatsby.
44

55
* Supports web fonts & self-hosted fonts
6-
* Suports self-hosted fonts
76
* Preloads the files & preconnects to the URL
87
* Loads fonts asynchronously to avoid render blocking
98
* Implemented with [fast loading snippets](https://csswizardry.com/2020/05/the-fastest-google-fonts/)
109
* Loading status listener for avoiding FOUT & FOUC
10+
* Small size & minimal footprint
1111

1212
## Install
1313

gatsby-browser.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { getFontFiles, getFontNames } from "./utils"
44

55
export const wrapRootElement = (
66
{ element },
7-
{ custom, web, enableListener }
7+
{ custom = [], web = [], enableListener }
88
) => {
99
const allFonts = [...custom, ...web]
1010
const fontFiles = getFontFiles(allFonts)

gatsby-ssr.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import {
77

88
export const onRenderBody = (
99
{ setHeadComponents, setPostBodyComponents },
10-
{ enableListener, preconnect, web, custom }
10+
{ enableListener, preconnect = [], web = [], custom = [] }
1111
) => {
1212
const allFonts = [...web, ...custom]
1313
const preload = getFontFiles(allFonts)

0 commit comments

Comments
 (0)