yew icon indicating copy to clipboard operation
yew copied to clipboard

Reformat "Hooks" section of docs

Open loenard97 opened this issue 2 years ago • 1 comments

This is about:

  • [ ] A typo
  • [ ] Innaccurate/misleading documentation (e.g. technically incorrect advice)
  • [ ] Undocumented code
  • [ ] Outdated documentation
  • [x] Improvement to existing documentation
  • [ ] Other

Problem The State page and the Hooks page of the docs talk about the same concepts.

  • Hooks explains how to use hooks to store state
  • State explains which hook to use for which type of state

I would suggest combining these two pages into one, because of their similarity. The table in 'State' could be combined together with the list of 'Hooks/Pre-defined Hooks'. The headline of the page could then be something like "Storing state with Hooks".

Additionally the "Custom Hooks" page is a single subsection, which is considered bad writing style: Stackexchange discussion. Either a section has not enough content to be split into subsections, or it has enough content to be split into multiple subsections. The Hooks section has enough content to divide it into two subsections, so I would suggest a structure like this:

  • Storing state with Hooks (contains: short introduction on the concept of hooks and links to further reading material)
    • Predefined Hooks (contains: rules on hooks and the table from "State" listing all predefined hooks)
    • Custom Hooks (contains: how to write custom hooks)

Questionaire (Optional)

  • [x] I'd like to write this documentation
  • [ ] I'd like to write this documentation but I'm not sure what's needed
  • [ ] I don't have time to add this right now, but maybe later

loenard97 avatar Oct 26 '23 10:10 loenard97

I would like to have a section about state somewhere other than hooks as well. Perhaps it can be in the components intro page? We can also move the table to docs.rs since that's where all the docs about predefined hooks are. Custom hooks and hooks page should be combined, I agree.

Would you like to PR?

ranile avatar Oct 26 '23 14:10 ranile