title: having access to a parent state from component's props.children:
body: <p>I am making a container for a d3 line graph that I'm going to create, my format so far is this: </p>
  
  <pre><code>import React from "react";
  import AnalyticPads from "../AnalyticPad/AnalyticPad";
  import Pad from "../AnalyticPad/Pad";
  import MainContent from "../AnalyticPad/MainContent";
  import Extention from "../AnalyticPad/Extention";
  
  
  
  const GraphPad = () =&gt; {
  
      return ( 
          &lt;AnalyticPads properties={{height: "200px"}}&gt;
              &lt;Pad&gt;
                  &lt;MainContent&gt;
  
                  &lt;/MainContent&gt;
                  &lt;Extention&gt;
  
                  &lt;/Extention&gt;
              &lt;/Pad&gt;
          &lt;/AnalyticPads&gt;
      )
  
  }
  
  export default GraphPad;
  </code></pre>
  
  <p>And my "AnalyticsPad" looks like this:</p>
  
  <pre><code>import React from "react";
  
  const AnalyticPads = (props) =&gt; {
  
      return ( 
  
         &lt;div className="analytic-pad-container"&gt;
              {props.children}
         &lt;/div&gt;
      )
  
  }
  
  export default AnalyticPads;
  
  </code></pre>
  
  <p>What I want is that there will be a grid of "Pads" and I want this "AnalyticsPad" to provide default styles for each pad, for example if I want each pad to have a height of 200px I set it in this wrapper and then for any individual pad that I want to differ from the default I can overide it. </p>
  
  <p>The "MainContent" component is where the line graph will be and any extra information will be put inside the "Extention" which will render if a button is pressed.</p>
  
  <p>Throughout my react app I keep using the context api to provide the data to the children components, but I know ( or think ) it is bad practice to do this, from what I understand context should only be used for providing data to global components. </p>
  
  <p><em>What is best practice?</em></p>
  
  <p>please don't answer with a solution for class components as I have never used them before as I am new to react.</p>