NextJS Flashcards
What are the 3 base components of web development?
HTML, CSS, Javascript
How is the DOM represented?
Javascript representation of HTML
Who keeps the DOM and HTML in sync?
The browser
What is the virtual DOM?
a javascript representation of the DOM created by React to allow for faster updates
Explain imperative programming vs declarative programming using an example
Imperative is like giving recipe instructions to someone to make a pizza.
Declarative is like ordering a pizza without being concerned how its made.
is React a declarative or imperative library?
declarative
What’s an example of a JS compiler?
Babel
Why do you need to compile your React code?
React uses JSX which needs to be compiled into JavaScript.
What is a component?
React’s tool for UI blocks.
What do components return?
JSX
What is SSR?
Server Side Rendering: the HTML of the page is generated on the server at request time
What is SSG?
Static Site Generation: the page is generated on the server, at build time, and stored in a CDN.
What function should you export if you want to generate HTML on the server at request time?
getSeverSideProps()
What function should you export if you want to generate HTML on the server at build time?
getStaticProps()
When should you use getServerSideProps()?
When you want data to be fetched at request time