Answer the question
In order to leave comments, you need to log in
How to attach more than one function to an event handler?
Tell me how to make it so that two handlers were hung on the onClick event at once?
function FirstWindowItems({item, isActive, onClick}) {
function handleClick(item){
// e.preventDefault();
console.log(item);
onClick();
}
return(
<div className={`row border ${isActive ? 'border-primary' : ''}`} onClick={handleClick(item), onClick}
>
{/* <div className = "window__item window__name">{item.id}</div> */}
<div className = "col-md">{item.FIO}</div>
<div className = "col-sm">{item.position}</div>
<div className = "col-sm">{item.birthDay}</div>
<div className = "col-sm"> {
item.sex ?
"М" : "Ж"
}
</div>
<div className = "col-sm">{
item.fired ?
"Уволен":"Работает"
}
</div>
</div>
)
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question