React · Senior · Question 11 of 75

How do you render a Server Component inside a client <Modal>?

Explanation

A client module can't import a server component - the import would make it a client component. But a server parent can render <Modal><ServerCart /></Modal>: ServerCart runs on the server, and Modal receives the ready result as children.

Further reading

Problem with a question

React · Senior · question 11

Test yourself

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

Take this quiz