I am aware that dynamic children of a component must have a unique key
as the following (modified example from official docs):
render: function() {
var results = this.props.results;
return (
{results.map(function(result) {
return <ChildComponent type="text" key={result.id} changeCallback={this.props.callbackFn}/>;
})}
);
}
Considering that ChildComponent
is another React component nested here, with a render
method as bellow
render: function() {
var results = this.props.results;
return (
<div className="something">
<input type="text" onChange={this.props.changeCallback} />
</div>
);
}
is there any way to access the key when callbackFn(event)
is called?