Next.js Discord

Discord Forum

Link rel

Unanswered
raf posted this in #help-forum
Open in Discord
rafOP
Hello everyone, i want to add adobe fonts and as i know with metada object is not possible to add <link rel="..." />
I found a ReactDom.preload function but do you know what will be the best way to implement this? When I create this function and import into layout.tsx gives me error about client component running on server what is obvious, but can you give me hint how to make this working?

Thank you

6 Replies

rafOP
What you mean exactly? 🙂
what are the requried <link rel=" "/> tags to add adobe fonts?
rafOP
Yep, we have multiple fonts depending on env and we switching them. So firsly we adding this by head and inserting link rel, but that causing hydration issue
Why not just download the fonts directly and use them? NextJS downloads + optimized google fonts at build time any way so you're basically self hosting the fonts anyway.
The only issue i can see from what you said is that you are switching fonts up which may get annoying.