Complete the code to import a global CSS file in a Next.js app.
import '[1]';
In Next.js, global CSS files are imported in the _app.js or _app.tsx file using a relative path like './styles/global.css'.
Complete the code to create a custom App component that applies global CSS in Next.js.
export default function MyApp({ Component, pageProps }) {
[1]
}The custom App component must return the page component with its props using <Component {...pageProps} /> to render pages correctly.
Fix the error in this _app.js file by completing the import statement for global CSS.
import [1] from 'next/app'; import './styles/global.css'; export default function MyApp({ Component, pageProps }) { return <Component {...pageProps} />; }
To extend the default App in Next.js, you import App from 'next/app'. This is needed if you customize the App component class.
Fill both blanks to correctly import and use global CSS in a Next.js app.
import [1] from 'next/app'; import [2]; export default function MyApp({ Component, pageProps }) { return <Component {...pageProps} />; }
You import App from 'next/app' if extending it, and import the global CSS file with its relative path.
Fill all three blanks to create a working _app.js file that applies global CSS in Next.js.
import [1] from 'next/app'; import [2]; export default function [3]({ Component, pageProps }) { return <Component {...pageProps} />; }
The default export function is usually named MyApp. You import App from 'next/app' if needed, and import the global CSS file by its path.