in gatsbyssr.js it seems that onLoad function attached to React elements does not works #30481
Unanswered
mario-arduini
asked this question in
Help
Replies: 1 comment
-
The The plugin https://github.com/codeAdrian/gatsby-omni-font-loader that also implements the article you linked uses |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Description
I have created a simple plugin to efficiently and asynchronously add google fonts to your gatsby project, it simply adds 4 link elements using
onRenderBody
API , but is not able to load the fonts on the page.plugin
gatsby-ssr.js
:The links are correctly added, but it seems that the onLoad function is not called for the
defaultLink
(in the inspector it stays as media='print'), also the previouspreload
does not work as well.The reason for this links comes from this article
Steps to reproduce
npm i gatsby-plugin-fast-google-fonts
gatsby-config.js
options > link
The github repo of the plugin is : https://github.com/mario-arduini/gatsby-plugin-fast-google-fonts
A minimal repo reproducing the problem is : https://github.com/mario-arduini/sandbox
Expected result
fonts should be available and usable
Actual result
fonts are not displayed properly
Environment
Thank you for any pointer or help and have a great day :)
Beta Was this translation helpful? Give feedback.
All reactions