title: ReactJs - Access Wrapped State from HOC Wrapper
body: <p>Im trying to use HOC pattern instead of Object Oriented to avoid redundant code.</p>
  
  <p>The situation is simple as explained below:</p>
  
  <p><a href="https://i.stack.imgur.com/NvuQr.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/NvuQr.jpg" alt="enter image description here"></a></p>
  
  <p>In HomePage I have something like this:</p>
  
  <pre><code>const WrappedComponent = Wrapper(Wrapped);
  &lt;WrappedComponent { ...this.props } /&gt;
  </code></pre>
  
  <p>In the Wrapper "component", I want to expose a method called <code>foo_method</code> that is an Ajax Call to a WebServer. The result must be written in the state of Wrapped Component.</p>
  
  <p>Now, WrappedComponent can call <code>foo_method</code> but when inside Wrapper, I have no scope of Wrapped state and <code>this.props</code> contains the props of HomePage, not wrapper so I cant create a callback function in Wrapper to be called.</p>
  
  <p>Am I forgetting something in the implementation of HOC?</p>