Skip to content
This repository has been archived by the owner on Jul 19, 2020. It is now read-only.

4/8 review of the properties page #85

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

rlasjunies
Copy link

The previous content on the "## Memory/speed overhead of using Properties" is maintained as is

{% hint style="info" %}
Types for which you derive `Properties` must also implement `Clone`. This can be done by either using `#[derive(Properties, Clone)` or manually implementing `Clone` for your type.
{% endhint %}
The properties bag is attached to the state adding the field `props` in the component struct and defining the `Properties` `Type` in the component trait implementation.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't need to add a field props in the struct implementing Component.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mistake from my learning. I was following the # Optimizations & Best Practices. Where it is recommend to attach.
After few days ... I assumed it was necessary :-(

I will remove the reference to the concept of attaching.

I will do it after lunch ... ;-)

@teymour-aldridge
Copy link
Contributor

teymour-aldridge commented May 9, 2020 via email

@teymour-aldridge
Copy link
Contributor

teymour-aldridge commented May 9, 2020 via email

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants