all your buttons depends on the same state, thats why when you changing it all buttons disappear. You have two options: either wrap button and text in a component and store this state inside it (in this case every button will have separated state) or change the state to store an array with ids or some other button identifier and check in ternary if that array includes button’s id.