Blog
This commit is contained in:
@@ -73,7 +73,7 @@ pub fn App(cx: &Arc<Context>) -> View {
|
||||
|
||||
* **Parameter Names**: The names of your function parameters (e.g., `name`, `age`) become the names of the props you use when instantiating the component in `rsx!`.
|
||||
* **Reference Types**: Props are typically passed as references (e.g., `&str`, `&u8`). The `#[component]` macro automatically "strips" the reference when generating the internal component struct, storing the owned type. This means you don't need to manually clone values unless you intend to move them into a closure or `State`.
|
||||
* **`children` Prop**: As seen in the [previous guide](../intro/03-example-basic-component.md), any content nested inside a component's `rsx!` invocation is implicitly passed as a `children: &Rsx` prop. This allows for flexible content composition.
|
||||
* **`children` Prop**: As seen in the [previous guide](/docs/intro/03-example-basic-component.md), any content nested inside a component's `rsx!` invocation is implicitly passed as a `children: &Rsx` prop. This allows for flexible content composition.
|
||||
|
||||
### Example: Component with `children` and custom props
|
||||
|
||||
|
||||
@@ -151,5 +151,3 @@ The `MyCustomLayout` component above demonstrates a basic two-column layout. You
|
||||
* **Composition**: Layout components can themselves be children of other layout components, allowing you to build complex nested structures.
|
||||
|
||||
While implementing a full layout system like CSS Flexbox is beyond the scope of OSUI's core, these primitives empower you to craft highly customized and visually rich terminal interfaces by manually managing space and component placement.
|
||||
|
||||
**Next:** Explore the detailed [API Reference](../reference/00-crate-structure.md) for all OSUI modules and types.
|
||||
|
||||
Reference in New Issue
Block a user