What is Next.js?
A React framework that …
What are 5 differences between React and Next.js?
What enables routing in Next.js?
Files added to the ‘pages’ folder will automatically be rendered with the matching url.
What element should be used for internal links?
the Link element
———————————————————————————————-
import Link from ‘next/link’;
Example
What element should be used for external links?
The anchor element (<a></a>)
How/where should attributes like ‘className’ be added to links?
Inside the anchor tag, which is wrapped inside Next’ Link element
———————————————————————————————-
import Link from ‘next/link’;
<a>link</a>
How can metadata such as be modified?
By importing and using Next’ element
How can the element be customized in Next.js?
By creating a ‘_document.js’ page inside the ‘pages’ folder (/pages/_document.js)
What is the advantage of the Next.js element vs the HTML element?
It optimizes when additional scripts are fetched and executed.
What additional properties does the element have?
What styling methods does ext.js have built-in support for?
How can global styles be loaded?
By importing the styles into the ‘pages/_app.js’ file (cannot be imported in other files).
What function is used for static generation with data?
getStaticProps()
———————————————————————————————-
export async function getStaticProps() {
// get external data const data = ...
// return props to pass to the component
return { props: ... }}