Next.js Discord

Discord Forum

Why google font is not being applied

Unanswered
Ratonero Valenciano posted this in #help-forum
Open in Discord
Avatar
Ratonero ValencianoOP
import Image from 'next/image';
import { Poppins } from 'next/font/google';
import Navbar from './components/Navbar';

const poppins = Poppins({ 
  weight: ['800','500','600','400','700'],
  subsets:['latin']  
});

export default function Home() {
  return (
    <main style={poppins.className} className="min-h-screen">
<Navbar/>
    </main>
  )
}

1 Reply

Avatar
Ratonero ValencianoOP
Unhandled Runtime Error
Error: The `style` prop expects a mapping from style properties to values, not a string. For example, style={{marginRight: spacing + 'em'}} when using JSX.