-
Notifications
You must be signed in to change notification settings - Fork 651
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
docs: using server components in islands #2416
docs: using server components in islands #2416
Conversation
return ( | ||
<Card> | ||
Counter is at {count}.{" "} | ||
<Button onClick={() => (count.value += 1)}>+</Button> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I file like we should add a sentence that this click handler will only fire when this component is inside ./islands
or referenced inside an island. I'm worried that the component name here suggests that this component would be treated as an island.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @marvinhagemeister
I hoped the positioning in the docs would have helped clarify that as I didn't want to be overly verbose, but I've added a sentence as you mention to make sure it's explicitly known. Let me know what you think.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sweet, thanks for adding this to our docs 👍
After reading the discussion at #2369, this PR introduces a small addition to the docs which highlights how you can use server components within islands.
This, coupled with the existing docs, should hopefully give people enough of an example to understand that islands provide the interactivity layer, and that server components within them can be hydrated and made interactive too.
Closes #2369