Replies: 5 comments 3 replies
-
Disposal is async so it's best not to make assumptions about how quick it happens. However it doesn't sound like this is your main concern here.
That is true, at least with respect to parent-child relationships between components. Every component has zero or one parent, and the graph must be acyclic since children can only be added to parents that already exist and cannot move to a new parent later. I don't know how you could be getting the infinite recursion issue. Possibilities could be:
If you have a minimal repro I'm sure we could track it down. |
Beta Was this translation helpful? Give feedback.
-
@SteveSandersonMS, I have continued my investigation and stumbled onto something (related): The As you can see in the screenshot below, the component with ID = 5 shows up twice, once with 5 edits and once with 0 edits. Do you know if this is expected? The component's code looks like this: <div>
<EditForm Model='Entity'>
<RadzenNumeric TValue='decimal?' @bind-Value='PaymentPercentFormatted'
Format='N6'
Min='0'
Max='100'>
</RadzenNumeric>
</EditForm>
</div>
@code {
public decimal? PaymentPercentFormatted
{
get => Entity.PaymentPercent * 100m;
set => Entity.PaymentPercent = value / 100m;
}
public CounterEntity Entity { get; set; } = new CounterEntity
{
Id = 100,
PaymentPercent = .25m
};
public class CounterEntity
{
public long Id { get; set; }
public decimal? PaymentPercent { get; set; }
}
} The Is this expected (.NET 7)? |
Beta Was this translation helpful? Give feedback.
-
Yes, it's always been the case. Components can render any number of times in a single batch. For example component A renders child B, which in turn does something that synchronously triggers the re-rendering of A. Then you'd get a batch with renders for A, B, A. |
Beta Was this translation helpful? Give feedback.
-
That can't be done because the updates might not make sense in that order. Consider a case where A renders B, then B triggers a re-render of A, which then deletes B. We have a batch containing renders for A, B, A. If somehow we tried to coalesce together the two entries for A, then we'd have A, B, but the render for A would contain an instruction to delete B even though it hasn't yet been created. |
Beta Was this translation helpful? Give feedback.
-
Can you please explain |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi @SteveSandersonMS et al,
I am tracking down a bug in bUnit, and want to validate some assumptions I have about a component's render tree frames.
The scenario: In
Renderer.UpdateDisplayAsync
, bUnit will get all render tree frames for a component and its child components to be able to build the markup for the component and its child components.Getting all render tree frames for a component tree is done by calling a method like
GetCurrentRenderTreeFramesDeep
below (simplified for brevity) fromUpdateDisplayAsync
:My assumption has been:
GetCurrentRenderTreeFrames(componentId)
does not return aframe.FrameType == RenderTreeFrameType.Component
whereframe.ComponentId
references a component that was disposed in the current render cycle.component A
to have a frame pointing tocomponent B
which has a frame pointing tocomponent A
(directly or indirectly through other components).However, at least the second or third assumption seems to be wrong. A user has reported a stack overflow involving a method like
GetCurrentRenderTreeFramesDeep
above, indicating a cyclic reference between two or more components (using .NET 7.0.5).Are my assumptions right? If not, please outline the cases where they are not.
Beta Was this translation helpful? Give feedback.
All reactions