const Check = props => {
return(
props.boxes.map((el,i)=>{
return(
<div
key={el.id}
className = 'check'
>
<div className='check--conteiner'>
<label htmlFor={el.name}>{el.name}</label>
<input id={el.name} onChange={(evt)=>props.checkHandler(evt, el)} type = 'checkbox' value={el.name}/>
<img className={el.checked?'checked':null} src={el.src} alt={el.name}/>
</div>
</div>
)
})
)
}
state{
randomList: null,
list:[1,2,3,4,5]
}
random()=>{
this.setState({
randomList: this.state.list.randomizer()
})
}
render(){
<somethink list = {this.state.randomList}
}