# ComponentElement

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-view/element/struct-componentelement/

**struct** · [`ferroui-view`](/docs/0.5.0/api/ferroui-view/) · v0.5.0

```rust
struct ComponentElement
```

A component that runs again: its function runs when it is mounted, again
whenever a signal it read changes or its parent runs again, and what it
returns is patched into the controls it made before (see [`rerender`](/docs/0.5.0/api/ferroui-view/element/function-rerender/) and
the hooks).

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.View/element.rs#L286)

## Members

- [`name`](#struct_field-name)
- [`type_id`](#struct_field-type_id)
- [`key`](#struct_field-key)
- [`render`](#struct_field-render)
- [`props`](#struct_field-props)

<a id="struct_field-name"></a>

### name

```rust
name: &'static str
```

The name of the component, for messages.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.View/element.rs#L288)

<a id="struct_field-type_id"></a>

### type_id

```rust
type_id: std::any::TypeId
```

The identity of the component: a component of another identity at
the same place is mounted anew.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.View/element.rs#L291)

<a id="struct_field-key"></a>

### key

```rust
key: Option<Key>
```

The key among its siblings.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.View/element.rs#L293)

<a id="struct_field-render"></a>

### render

```rust
render: std::rc::Rc<dyn Fn() -> Element>
```

Runs the component with what its parent gave it.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.View/element.rs#L295)

<a id="struct_field-props"></a>

### props

```rust
props: Option<std::rc::Rc<dyn AnyValueEq>>
```

What its parent gave it, when the component is memoized: a parent
that runs again with equal values does not run it again.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.View/element.rs#L298)

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- [`IntoValue<T>`](/docs/0.5.0/api/ferroui-view/builder/trait-intovalue/)
- [`FromValue<T>`](/docs/0.5.0/api/ferroui-view/builder/trait-fromvalue/)
- [`FromValue<Option<T>>`](/docs/0.5.0/api/ferroui-view/builder/trait-fromvalue/)
- [`IntoProp<T, Value>`](/docs/0.5.0/api/ferroui-view/builder/trait-intoprop/)
- `Borrow<T>`
- `BorrowMut<T>`
- `CloneToUninit`
- `Into<U>`
- `From<T>`
- `TryInto<U>`
- `TryFrom<U>`
- `Any`
- `ToOwned`
- [`ClassDefaults`](/docs/0.5.0/api/ferroui-base/trait-classdefaults/)
- `ErasedDestructor`
- `IntoEither`
- `Clone`

## Availability

Extracted for `aarch64-apple-darwin`. Cargo features are listed in the [crate index](/docs/0.5.0/api/).
