-
Notifications
You must be signed in to change notification settings - Fork 0
Troubleshooting
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
Fragmentor equivalent child layout.
Mounting a pure Nestix tree without host components will build a runtime tree but will not display anything.
Check the renderer's on_place logic.
Typical placement behavior:
- If
placement.predexists, insert after that host node. - Else if
placement.parentexists, append to that host node. - 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.
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.
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 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())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:?}");
});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.
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.