Skip to content

Troubleshooting

wirelessEye edited this page Jun 29, 2026 · 1 revision

Troubleshooting

Nothing Appears on Screen

Nestix core does not render host UI by itself. Make sure the mounted tree contains renderer components that:

  • create host objects;
  • call element.provide_handle(...);
  • register element.on_place(...);
  • attach children through a Fragment or equivalent child layout.

Mounting a pure Nestix tree without host components will build a runtime tree but will not display anything.

A Child Is Not Inserted in the Right Place

Check the renderer's on_place logic.

Typical placement behavior:

  1. If placement.pred exists, insert after that host node.
  2. Else if placement.parent exists, append to that host node.
  3. Otherwise do nothing or handle the root case.

Also make sure every host component calls provide_handle; otherwise descendants and siblings cannot find parent or predecessor handles.

Props Do Not Update Reactively

Prop reads must happen inside a tracked context to update automatically.

Use effect! for host synchronization:

effect!([node, props.value] || {
    node.set_value(&value.get());
});

Use computed! for derived prop values:

Text(computed!([count] || count.get().to_string()))

Reading props.value.get() once during mount only reads the initial value.

Required Prop Builder Errors

Fields are required unless:

  • the field type is Option<T>;
  • the field has #[props(default)];
  • the field has #[props(default = expr)];
  • the field has #[props(start)].

Add the missing .field = value assignment or mark the field with an appropriate default.

Capture Macro Needs an Explicit Identifier

Capture lists can infer names for simple expressions, such as:

callback!([count] || count.get())
callback!([props.value] || value.get())

For complex expressions, provide an alias:

callback!([label: make_label()] || label.clone())

Effect Runs More Than Expected

Effects rerun whenever any signal read during their previous run changes. Move incidental reads into untrack if they should not subscribe the effect.

effect!([state] || {
    let snapshot = untrack(|| state.get());
    log::debug!("{snapshot:?}");
});

List Items Lose State

Keyed lists reuse children by key. If keys change between renders, Nestix treats items as new children.

Use stable keys:

for item in items.clone() where key = |item| item.id.clone() {
    Row(.item = item)
}

Avoid using display text, indices, or mutable values as keys when item identity should persist.

Cyclic Updates

In debug builds, enable cyclic update warnings:

debug_signals(DebugConfig {
    detect_cyclic: true,
});

This logs a warning when an effect attempts to trigger itself while already running.

Clone this wiki locally