React Flashcards
1
Q
Why React
A
- It encourages the creation of reusable UI components which present data that changes over time.
- In order to perform updates as efficiently as possible, we diff the return value from the previous call to render with the new one, and generate a minimal set of changes to be applied to the DOM.
2
Q
Imperative vs Declarative
A
Imperative: Writing the steps for how the user interface should be updated.
Declarative: Instead of having to write DOM methods, it would be helpful if developers were able to declare what they want to show (in this case, an h1 tag with some text).
When it comes to building user interfaces, a declarative approach is often preferred because it can speed up the development process.
3
Q
Why Next
A
- CSR, SSR, SSG (with ISR)
- optimization: images, SEO, font
– font: downloads font files at build time and hosts them with your other static assets
– image: Preventing layout shift automatically when images are loading, resizing images to avoid shipping large images to devices with a smaller viewport, lazy loading - Simplified, file-based routing
- webpack and Babel setup pre-configured