Refactor: move Component docs into the components directory to reflect how they are presented in the guide

This commit is contained in:
Reinis Mazeiks committed 2022-02-10 10:07:33 +02:00
1 parent 67766c7b59
commit 02d8e66f40
7 files changed
+6 -6

No files matched your search

+5 -5
View File
@@ -9,11 +9,11 @@
- [Conditional Rendering](elements/conditional_rendering.md) - [Conditional Rendering](elements/conditional_rendering.md)
- [Lists](elements/lists.md) - [Lists](elements/lists.md)
- [Special Attributes](elements/special_attributes.md) - [Special Attributes](elements/special_attributes.md)
- [Components](elements/components.md) - [Components](components/index.md)
- [Properties](elements/propsmacro.md) - [Properties](components/propsmacro.md)
- [Reusing, Importing, and Exporting](elements/exporting_components.md) - [Reusing, Importing, and Exporting](components/exporting_components.md)
- [Children and Attributes](elements/component_children.md) - [Children and Attributes](components/component_children.md)
- [How Data Flows](elements/composing.md) - [How Data Flows](components/composing.md)
- [Thinking Reactively]() - [Thinking Reactively]()
- [Thinking Reactively]() - [Thinking Reactively]()
- [Thinking Reactively]() - [Thinking Reactively]()
File renamed without changes.
File renamed without changes.
+1 -1
View File
@@ -130,7 +130,7 @@ Remember: keys let Dioxus uniquely identify an item among its siblings. A well-c
You might be tempted to use an item's index in the array as its key. In fact, that’s what Dioxus will use if you don’t specify a key at all. This is only acceptable if you can guarantee that the list is constant – i.e., no re-ordering, additions or deletions. In all other cases, do not use the index for the key – it will lead to the performance problems described above. You might be tempted to use an item's index in the array as its key. In fact, that’s what Dioxus will use if you don’t specify a key at all. This is only acceptable if you can guarantee that the list is constant – i.e., no re-ordering, additions or deletions. In all other cases, do not use the index for the key – it will lead to the performance problems described above.
Note that if you pass the key to a [custom component](./components.md) you've made, it won't receive the key as a prop. It’s only used as a hint by Dioxus itself. If your component needs an ID, you have to pass it as a separate prop: Note that if you pass the key to a [custom component](../components/index.md) you've made, it won't receive the key as a prop. It’s only used as a hint by Dioxus itself. If your component needs an ID, you have to pass it as a separate prop:
```rust ```rust
Post { key: "{key}", id: "{key}" } Post { key: "{key}", id: "{key}" }
``` ```