qwik icon indicating copy to clipboard operation
qwik copied to clipboard

[📖] Add document for Hooks

Open Nefcanto opened this issue 2 years ago • 7 comments

Suggestion

I searched your docs and could not find a page explaining hooks and their rules. For example, is it necessary to be prefixed with use just as the same as the react? Is it essential to use hooks only on the top level of a component?

I just found this tutorial.

But I think it's better to have a hooks page too specifically if Qwik hooks have differences from React hooks.

Nefcanto avatar Nov 26 '22 03:11 Nefcanto

i will start working on it

the-r3aper7 avatar Nov 27 '22 16:11 the-r3aper7

I think all the hooks (mostly) there in the docs, but spread out through the Component API sections (Lifecycle, resource, context, etc)

nnelgxorz avatar Nov 27 '22 23:11 nnelgxorz

i think we should have separate section named use- hooks. WDYT?

the-r3aper7 avatar Nov 28 '22 03:11 the-r3aper7

I think the docs are always a work in progress and if you have a good idea for improving them, go for it! 😄

nnelgxorz avatar Nov 28 '22 03:11 nnelgxorz

yeah i will make PR very soon busy in college right now.

the-r3aper7 avatar Nov 28 '22 04:11 the-r3aper7

We have some docs here: https://qwik.builder.io/docs/components/lifecycle/#use-method-rules

but i agree! this deserve its own section, maybe adding something new in advanced ?

manucorporat avatar Nov 28 '22 14:11 manucorporat

#2301

the-r3aper7 avatar Nov 28 '22 17:11 the-r3aper7