ЕИ
Size: a a a
OT
PM
А
А
mP
Ю
IS
IS
Ю
CG
export interface IExp {
name: string;
clickHandler: () => void;
}
export default function Exp(props: IExp) {
const [isHide, setIsHide] = useState(false);
const clickHandler = () => {
props.clickHandler();
setIsHide(true);
}
return (
<button onClick={clickHandler} className={isHide ? 'hide' : ''}>
{props.name}
</button>
);
}
где props.clickHandler(); меняет название кнопки через пропс (props.name)IS
IS
CG
D
D
OW