I'm kind of new to React and I'm having difficulty in invoking components through onClick event of a button.
Given below is the code segment
function Dev({value}){
return(
<Card>
<CardImg top width="100%" src={value.src} alt="Card image cap" />
<CardBody>
<CardTitle className='text-card'>{value.title}</CardTitle>
<CardText className='text-text'>{value.text}</CardText>
<Button className='text-button' onClick={(value)=>{
return(
<div>
{value.id ? <Login /> : <Sign />}
</div>
)
}}>{value.button}<i class={value.icon} aria-hidden="true"></i></Button>
</CardBody>
</Card>
);
}
value.id is either true or false, but either way the onClick is not firing.
The components Login and Sign are actually components consisting of a Modal.
Some help is deeply appreciated.