import React, { useState } from 'react';
import Hi from './Hi'
function display(){
return <Hi/>
}
export const Main = () => {
const [isHiVisible, setHiVisible] = useState(false);
const onClick = () => {
setHiVisible((prev) => !prev);
}
return (
<div>
<button onClick={onClick}>отобразить</button>
{isHiVisible &&
<Hi/>
}
</div>
);
};