title: React - Change state in child component from another child component
body: <p>I need to change the state in one child component when a button is clicked in another child component. Both the childs have the same parent component.</p>
  
  <pre><code>import React from "react":
  import A from "...";
  import B from "...";
  
  class App extends React.Component {
      render() {
          &lt;div&gt;
              &lt;A /&gt;
              &lt;B /&gt; 
          &lt;/div&gt;
      }
  }
  </code></pre>
  
  <p>In this example, when a button in component A is pressed, the state in component B needs to be changed.</p>