ReactJS displaying / hiding parallel components
<p>Preface: I'm very new to ReactJS, so my question will reflect my lack of understanding of how things work. Right now I'm using React + Alt.</p>

<p>I have a basic page with a parent component (I'll call it <code>MyContainer</code>) that has multiple parallel panel-esque components (<code>MyPanel</code>) displayed side by side. What I'm now trying to implement is each panel component has an Expand icon that when clicked, will make that panel take up the full width of its parent container (ie. <code>width:100%</code>) and hide all other panels (ie: <code>display:none</code> or <code>visibility:hidden</code>). When the button is clicked again, the initial state of all panels is again shown.</p>

<p>So my question is the proper way to implement this in ReactJS/Alt. So far I have the easy part done, which is listening for the Expand button click and updating the state of whether the panel should be displayed as normal or full-width.</p>

<pre><code>export default class MyPanel extends React.Component {
  constructor(props) {
    super(props);
    this.state = {
      expanded: false
    };
    this.handleExpand = this.handleExpand.bind(this);
  }

  handleExpand() {
    this.setState({ expanded: !this.state.expanded });
  }

  render() {
    var expandStyle = {};
    if (this.state.expanded) {
        expandStyle.width = 'calc(100% - 40px)';
    }

    return(
      &lt;div style={expandStyle}&gt;
        &lt;ExpandButton onExpandEvent={this.handleExpand} /&gt;
        {/* Rest of panel props data rendered here */} 
      &lt;/div&gt;
    );
  }
}
</code></pre>

<p>The part I don't know how to do is have this component tell its sibling components whether they should hide or show itself. Trying to find similar questions here, I <em>think</em> there are two approaches: using props in the parent component to keep track of which panels are hidden or shown, or using Store/Actions to keep track of this, but I'm not sure on the implementation of either.</p>

<p>Again, I'm new to ReactJS, so go easy on me :)</p>