Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RFC: React Server Module Conventions v2 #227

Merged
merged 9 commits into from
Oct 25, 2022
Prev Previous commit
Next Next commit
Remove copypasta comment
  • Loading branch information
sebmarkbage committed Oct 11, 2022
commit 729978b3e085e02f71f0c88b5db5cf5976aa181d
9 changes: 2 additions & 7 deletions text/0000-server-module-conventions.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,9 @@ function Parent() {
// Component.js
"use client";

function Child() {
// Component is of type Reference<T> where T is the type
// of the default export of Component.js
// Because of this React knows that it can't render it on
// the server and instead will leave it as a placeholder
// to later be rendered on the client.
function Component() {
let [state, setState] = useState(false);
return <Component onClick={() => setState(true)} value={state} />;
return <OtherClientComponent onClick={() => setState(true)} value={state} />;
}
```

Expand Down