Hiding items in React

  javascript, reactjs

So basically I want to hide a Button when I press on it.

const Button=()=>{
const [hideButton, setHideButton]= React.useState(false)
function Button(){
 setHideButton(false)
}
return(
<div>

<button onClick={setHideButton}> </button>
</div>
)
}

Source: Ask Javascript Questions

LEAVE A COMMENT