title: Why can't I curry a react component?
body: <p>I've been getting started with react-redux and finding it a very interesting way to simplify the front end code for an application using many objects that it acquires from a back end service where the objects need to be updated on the front end in approximately real time.</p>
  
  <p>Using a container class largely automates the watching (which updates the objects in the store when they change). Here's an example:</p>
  
  <pre><code>const MethodListContainer = React.createClass({
    render(){
      return &lt;MethodList {...this.props} /&gt;},
  
    componentDidMount(){
      this.fetchAndWatch('/list/method')},
    componentWillUnmount(){
      if (isFunction(this._unwatch)) this._unwatch()},
  
    fetchAndWatch(oId){
      this.props.fetchObject(oId).then((obj) =&gt; {
        this._unwatch = this.props.watchObject(oId);
        return obj})}});
  </code></pre>
  
  <p>In trying to supply the rest of the application with as simple and clear separation as possible, I tried to supply an alternative 'connect' which would automatically supply an appropriate container thus:</p>
  
  <pre><code>const connect = (mapStateToProps, watchObjectId) =&gt; (component) =&gt; {
    const ContainerComponent = React.createClass({
      render(){
        return &lt;component {...this.props} /&gt;
      },
  
      componentDidMount(){
        this.fetchAndWatch()},
      componentWillUnmount(){
        if (isFunction(this._unwatch)) this._unwatch()},
  
      fetchAndWatch(){
        this.props.fetchObject(watchObjectId).then((obj) =&gt; {
          this._unwatch = this.props.watchObject(watchObjectId);
          return obj})}
    });
    return reduxConnect(mapStateToProps, actions)(ContainerComponent)
  };
  </code></pre>
  
  <p>This is then used thus:</p>
  
  <p>module.exports = connect(mapStateToProps, '/list/method')(MethodList)</p>
  
  <p>However, <code>component</code> does not get rendered. The container is rendered except that the <code>component</code> does not get instantiated or rendered. The <code>component</code> renders (and updates) as expected if I don't pass it as a parameter and reference it directly instead.</p>
  
  <p>No errors or warnings are generated.</p>
  
  <p>What am I doing wrong?</p>