score:15

Accepted answer

It means that this.props.selecteds[petitionId] is undefined at times. One thing you could do is give a default value to the checkbox like so.

<Checkbox
  value={this.props.selecteds[petitionId] || false}
  onChange={() => handleSelect(petitionId)}
 />

Warning note: don't use the defaultValue prop because it makes your component uncontrolled by definition.


Related Query

More Query from same tag