Currently, my focus is on adding a value when it is clicked. Despite attempting to use a conditional statement to check if the value has been clicked, I seem to be missing something or perhaps I am only targeting its value rather than the object itself.
<Row>
<p><b>Account Verification</b></p>
{
verifications.map(record => {
return(
<Col xs={12} md={3} mb={3}>
<Form.Group
key={record.id}
className="mb-3"
controlId={record.verifyName}
>
<Form.Check
id={record.verifyName}
onChange={e=> {
const value = e.target.value;
collection.push(value);
console.log(collection)
}}
key={record._id} tag="verify" value={record.verifyName} label={record.verifyName} />
</Form.Group>
</Col>
)
})
}
</Row>
My attempt so far involved using an if statement to wrap the collection array, but unfortunately, it did not yield the desired outcome.
if(value.checked == true) {
collection.push(valued)
}
I require assistance with this matter. The current system accepts data whether it has been checked or not as long as the value is clicked.