Next.js · Middle · Question 35 of 75

What happens when you import a server component into a 'use client' file?

Explanation

Everything imported from a client module goes into the client bundle. If the component accessed the DB, the build fails (or worse, the code reaches the browser). Pass a server component to a client one as children or another prop from a server parent.

Further reading

Problem with a question

Next.js · Middle · question 35

Test yourself

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

Take this quiz