I made two button component and when i click one i would like to render the other onClick to be able to disable (since they don't look the same).
const match = id;
const checkId = this.state.pokemon.includes(match);
{!checkId || this.state.isDisabled === true ? (
<button
onClick={() =>
this.setState({
isDisabled: true
})
}
>
Get Pokemon
</button>
) : (
<Button disabled/>
)}
</div>
The problem is that the button disable is only rendering when i refresh because is meeting the conditions of check Id but i have trouble Switching to the disable button directly after the click