Asteracea icon indicating copy to clipboard operation
Asteracea copied to clipboard

Nested components are initialised in the wrong order

Open Tamschi opened this issue 2 years ago • 0 comments

Given a component

asteracea::component! {
    Test()(/*…*/)

    <*A *ca={a}
        <*B *cb={b}
    >
}

, Asteracea will currently evaluate this in the order b - B - a - A, which may be unexpected.

It should be a - A - b - B, consistent with render-time evaluation. This can likely be achieved by (re-)parsing the container's binding earlier in component.rs (where child components are implemented), before parsing its content.

Sibling expressions should always run from top to bottom.

A test for both is necessary. Asserting and incrementing a counter in the relevant places should work there.

Tamschi avatar Feb 20 '22 12:02 Tamschi