Next.js Discord

Discord Forum

Is "use client"; inherited ?

Answered
Eurasian Blackbird posted this in #help-forum
Open in Discord
Eurasian BlackbirdOP
If I have a component like this
"use client";
import bar from '...'
export default function foo() {
  return <div><bar /><div>

Will my <bar /> componenet be a client component if I don't declare "use client"; in it ?
Answered by Northern Wheatear
Yes bar will be a client component
View full answer

2 Replies

Northern Wheatear
Yes bar will be a client component
Answer
@Northern Wheatear Yes bar will be a client component
Eurasian BlackbirdOP
thank you