The magic happens in your renderCountry
function. To add a checkbox you could change the return value in the CardBody
to something like this:
<CardBody>
<input type="checkbox" /> // Add the checkbox here
<p className="">
<img
src={blankImg}
className={"flag flag-" + code}
alt={country.name}
/>
</p>
<CardTitle title={country.name}>
{country.name.substring(0, 15)}
{country.name.length > 15 && "..."}
</CardTitle>
</CardBody>
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…