You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Quite often, our apps need to render a list of entities.
Entities usually contain some data and an identifier property like id or key.
Sometimes we may have some logic inside a component which uses that identifier, e.g. uses it inside some click handler to fire an event with id of the clicked entity.
We also find it natural to use these properties as a key prop when rendering a list for a proper component recycling.
However, with 0.12 key was moved out of props, and it doesn't seem to be available inside a component at all, so now we have to specify two different props-like values, which looks redundant:
<Entity
key={...}
entityId={...} />
Would be great to make key available inside a component once again in the future versions.
The text was updated successfully, but these errors were encountered:
Quite often, our apps need to render a list of entities.
Entities usually contain some data and an identifier property like
id
orkey
.Sometimes we may have some logic inside a component which uses that identifier, e.g. uses it inside some
click
handler to fire an event withid
of the clicked entity.Here is a simplified example:
We also find it natural to use these properties as a
key
prop when rendering a list for a proper component recycling.However, with 0.12
key
was moved out ofprops
, and it doesn't seem to be available inside a component at all, so now we have to specify two different props-like values, which looks redundant:Would be great to make
key
available inside a component once again in the future versions.The text was updated successfully, but these errors were encountered: