Live Chat Icon For mobile
Live Chat Icon

What is the use of @key directive?

Platform: Blazor| Category: Components

The @key directive is important when creating components dynamically by iterating list/IEnumerable. Adding the @key will ensure proper change detection and UI update in the collection of components.

Reference link: https://blazor-university.com/components/render-trees/optimising-using-key/

Share with

Share on twitter
Share on facebook
Share on linkedin

Related FAQs

Couldn't find the FAQs you're looking for?

Please submit your question and answer.