title: Is it possible to pass a React Component as argument in between functions of a Container Component
body: <p>Passing Child Components as arguments to functions of Parent Component and trying to render does not work</p>
  
  <pre class="lang-js prettyprint-override"><code>//React Container Component
  //Import Both Views and Render based on preference
  import PosterView from "./PosterView"
  import ListView from "./ListViewCard"
  
  ...
  
  renderCardsBasedOnType(cardType){
    if(cardType === "poster"){
       return this.renderCards(PosterView)
    }else{
       return this.renderCards(ListViewCard)
    }
  }
  renderCards(component){
    let cards =  this.props.list.map(function(cardData){
       return &lt;component data={cardData}/&gt;
     })
    return cards
  }
  render(){
    let cards = this.renderCardsBasedOnType("poster")
    return &lt;div&gt;{cards}&lt;/div&gt;
  }
  ......
  </code></pre>