codedamn

Key in react

Asked by Fuzail Kazi about 2 years ago

0

can you help me by explaining when to use key attribute in react?

1 Answer

    0

    Always include key attribute to React element when rendering multiple components.

    Keys help React identify which items have changed, are added, or are removed. Keys should be given to the elements inside the array to give the elements a stable identity, Keys should be uniqute for each given element.

    @shahroon

    Shahroon Farooqi

    @shahroon

Your answer