Check out example codes for "how to make a button disapear on click in javafx". It will help you in understanding the concepts better.

Code Example 1

public void letterChosen(ActionEvent event) {
    Button source = (Button) event.getSource();
    source.setVisible(false);
    System.out.println("pick: "+source.getUserData());
}

Learn ReactJs, React Native from akashmittal.com