Tools: Reactjs 0.14.0 Vanilla Flux
I need unique identifiers for 2 reasons:
As we already established in other answers that you can't use key
since it isn't passed as a prop and instead used internally by react. Here is my 2 cents as an alternative:
Since you're passing the entire array of messages as a prop while creating the
component, you don't necessarily need to pass another prop with id
. You can simply use {this.props.message.id}
whenever you need to use id.