RSC | Client boundaries
im a server component! (nope) undefined
const Page = () => {
return (
<div>
<ClientComponent />
</div>
);
};
'use client';
import { ServerComponent } from '@/app/rsc/client-boundary/ServerComponent';
export const ClientComponent = () => {
const [state, setState] = useState(0);
return (
<div>
<button onClick={() => setState(state + 1)}>{state}</button>
<ServerComponent />
</div>
);
};
export const ServerComponent = () => {
return <div>im a server component! (nope) {typeof window}</div>;
};