Skip to content

Commit 26c1788

Browse files
Update index.mdx
1 parent 4726409 commit 26c1788

File tree

1 file changed

+17
-0
lines changed
  • apps/website/src/routes/docs/contributing

1 file changed

+17
-0
lines changed

apps/website/src/routes/docs/contributing/index.mdx

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -382,6 +382,23 @@ Notice how `<ExampleRoot />` returns a `children` prop. This is because inline c
382382
383383
Context and hooks is still easy to use, create a new component called `<ExampleBase />` and return that instead of the div (with the children passed between) in the example above. From there, you can use context, hooks, and all the other Qwik goodies as a top level component.
384384
385+
```tsx
386+
return (
387+
<ExampleBase>
388+
{props.children}
389+
</ExampleBase>
390+
)
391+
392+
// use hooks, context, and other stuff here!
393+
export const ExampleBase = component$(() => {
394+
return (
395+
<div>
396+
<Slot />
397+
</div>
398+
)
399+
})
400+
```
401+
385402
## That's it!
386403
387404
Hopefully you should have enough to get up and running with Qwik UI Headless, if you have any questions don't let us stop you from reaching out, and happy building :qwik:

0 commit comments

Comments
 (0)