React Flashcards
1
Q
What’s the benefit of using arrow functions in onClicks?
A
Referencing a regular function with parameters won’t work, because the parathesis will invoke the function immediately. But calling the function inside an arrow function will work.
2
Q
In Next.js, what’s the difference between server components and client components? When do you decide what to use?
A
Server components render on the server and client components render in the browser. Server components are faster and should be used for most of the site, but client components are interactive so they can be small pieces where that interactivity is needed.