Next.js · Junior · Question 44 of 75

Can you use the useState and useEffect hooks in a server component?

Explanation

A server component runs once to produce a result and doesn't "live" afterwards. State, effects and event handlers are client features. A server component can render a client component and pass it data via props.

Further reading

Problem with a question

Next.js · Junior · question 44

Test yourself

Take the Next.js · Junior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz