iced icon indicating copy to clipboard operation
iced copied to clipboard

Improves the Documentation of `Component`

Open dtoniolo opened this issue 1 year ago • 0 comments

Hi, first of all thanks for your work on this amazing library: I've completed some toy projects with it and it was a pleasure to use.

While going through some of the examples I encountered a few challenges in understanding how Components work, particularly regarding:

  • How are the methods of a Component called? Is the invocation handled automatically by the runtime, or does this responsibility lie with the parent component?
  • Why is the state passed as an argument instead of being part of the Component?

After spending some more time experimenting and reasoning through these questions, I believe I've gained a better understanding. However, I realized that other newcomers might face similar difficulties, so I decided to add a couple of sections to the documentation of Component. I hope that these additions will help others grasp these concepts more quickly.

My contribution is based on my current understanding, so I'm completely open to feedback. If there are any inaccuracies or areas where improvements can be made, I'm more than willing to make the necessary revisions.

Lastly, if you think that expanding the documentation on this topic more would be valuable, I'd be happy to put together a pull request to add a dedicated page to the official book that explains how components work and how to use them effectively.

dtoniolo avatar Aug 23 '24 13:08 dtoniolo