Thanks for this awesome tutorial. I learned good react design here. But I do find a place that could be better.
It's in Part 3 - Conditional Operations. In UpdateDialog component, when we define the form input, we set
<p key={this.props.employee.entity[attribute]}>
This works most of the time, but it can't guarantee the key uniqueness. If firstName = lastName, we will have a problem. If we set
<p key={attribute}>
It can solve this problem because attributes are different by design. I notice we use this key assignment in CreateDialog component. So UpdateDialog component should follow the same pattern, right?
Hi,
Thanks for this awesome tutorial. I learned good react design here. But I do find a place that could be better.
It's in Part 3 - Conditional Operations. In UpdateDialog component, when we define the form input, we set
This works most of the time, but it can't guarantee the key uniqueness. If firstName = lastName, we will have a problem. If we set
It can solve this problem because attributes are different by design. I notice we use this key assignment in CreateDialog component. So UpdateDialog component should follow the same pattern, right?
Thanks