I want to create a checkbox dynamically according to the data in API and then call the function inside my render
function.
Can anyone suggest me any way, as I had used forEach
but the data seem do not passed and hence I'm getting an error: forEach is undefined
.
My snippet:
sizel=()=> this.state.data.sizes.forEach(function(size){
<CheckBox
title={size}
checked=''
/>
})