Skip to content

Blazor should throw when there are duplicate @key values in components #11908

@Andrzej-W

Description

@Andrzej-W

Describe the bug

Currently it is possible to create components with duplicate @key values. It is even documented:

If clashing @key values are requested within the same parent, the @key values won't be honored.

Expected behavior

Blazor should throw exception, because it is potentially serious bug with catastrophic consequences.

Additional context

People who use @key expect that it works. If it doesn't some serious bugs are possible, usually related to unexpected lifecycle methods calls.

Metadata

Metadata

Labels

DoneThis issue has been fixedarea-blazorIncludes: Blazor, Razor ComponentsbugThis issue describes a behavior which is not expected - a bug.

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions