This repository has been archived by the owner on Sep 16, 2022. It is now read-only.
Releases: joe-bell/next-google-fonts
Releases · joe-bell/next-google-fonts
v2.2.0
v2.1.0
Features
-
add "no-js" fallback (4f45eb2)
In the unlikely event that a visitor has intentionally disabled JavaScript, fall back to the original method. The good news is that, although this is a render-blocking request, it can still make use of the preconnect which makes it marginally faster than the default.
v2.0.0
Migration
Component
Switch any default imports to the new named { GoogleFonts }
import:
-- import GoogleFonts from "next-google-fonts";
++ import { GoogleFonts } from "next-google-fonts";
Types
The GoogleFontsProps
has been removed in favour of the interface IGoogleFontsProps
:
-- import { GoogleFontsProps } from "next-google-fonts";
++ import { IGoogleFontsProps } from "next-google-fonts";
Changelog
Refactor
- switches to named
GoogleFonts
export (8fdb19d)
Features
- upgrade peerDeps to latest
next
andreact
versions (8fdb19d)
v1.3.0
v1.1.0
v1.0.0
No more custom
_app.jsx
setup!
Migration
- Replace imports of
import { GoogleFonts } from "next-google-fonts";
toimport GoogleFonts from "next-google-fonts";
. - Move your
href
attribute and it's value fromGoogleFontsProvider
toGoogleFonts
e.g.// components/head.tsx import * as React from "react"; import GoogleFonts from "next-google-fonts"; export const Head: React.FC = () => ( <GoogleFonts href="https://fonts.googleapis.com/css2?family=Inter:wght@400;700&display=swap" /> );
- Remove the deprecated
GoogleFontsProvider
from your custom_app.jsx
or_app.tsx
. If you're not using any other contexts/providers, you may be able to remove this file altogether.