-
Notifications
You must be signed in to change notification settings - Fork 30
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
Islands component that accepts children #47
Labels
enhancement
New feature or request
Comments
Support children with server-side
ServerClientComponents.mp4const ChildContent3 = async () => {
await new Promise((resolve) => setTimeout(resolve, 1000))
throw new Error('Error in child content 3')
}
const ChildContent2 = async () => {
await new Promise((resolve) => setTimeout(resolve, 1000))
return (
<>
<p>Counter children 2</p>
<ErrorBoundary fallback={<p>Something went wrong</p>}>
<Suspense fallback="<p>Loading...</p>">
<ChildContent3 />
</Suspense>
</ErrorBoundary>
</>
)
}
const ChildContent1 = async () => {
await new Promise((resolve) => setTimeout(resolve, 1000))
return (
<>
<p>Counter children 1</p>
<Suspense fallback="<p>Loading...</p>">
<ChildContent2 />
</Suspense>
</>
)
}
const Children = async () => {
return (
<Suspense fallback="<p>Loading...</p>">
<ChildContent1 />
</Suspense>
)
}
export default createRoute((c) => {
const name = c.req.query('name') ?? 'no name'
return c.render(
<div class={className}>
<h1>Hello, {name}!</h1>
<Counter>
<Children />
</Counter>
</div>,
{ title: name }
)
}) |
Oops, forgot to get the attribute values! |
Great. The fix works for my site locally. I'm waiting for merge and publish. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What is the feature you are proposing?
Current islands component can not render
children
in the client side.If we were achieve this, it means we have "Donut Components" pattern.
One of the reasons is that the child is not passed in this part, but in addition to this, it seems necessary to modify the hydrate process when an island exists within an island.
The text was updated successfully, but these errors were encountered: