title: Is it possible to pass a component as props and use it in a child Component in Vue?
body: <p>In a Vue 2.0 app, let's say we have components A, B and C.</p>
  <p>A declares, registers and uses B</p>
  <p>Is it possible to pass C from A to B?</p>
  <p>Something like this:</p>
  <pre><code>&lt;template&gt;
    &lt;div class=&quot;A&quot;&gt;
      &lt;B :child_component=&quot;C&quot; /&gt;
    &lt;/div&gt;
  &lt;/template&gt;
  </code></pre>
  <p>And use C in B somehow.</p>
  <pre><code>&lt;template&gt;
    &lt;div class=&quot;B&quot;&gt;
      &lt;C&gt;Something else&lt;/C&gt;
    &lt;/div&gt;
  &lt;/template&gt;
  </code></pre>
  <p>The motivation: I want to create a generic component <code>B</code> that is used in <code>A</code> but receives from <code>A</code> its child <code>C</code>. Actually <code>A</code> will use <code>B</code> several times passing different 'C's to it.</p>
  <p>If this approach is not correct, what is the proper way of doing it in Vue?</p>
  <p><strong>Answering @Saurabh</strong></p>
  <p>Instead of passing as props, I tried the suggestion inside B.</p>
  <pre><code>&lt;!-- this is where I Call the dynamic component in B --&gt;
  
  &lt;component :is=&quot;child_component&quot;&gt;&lt;/component&gt;
  
  //this is what I did in B js
  components: {
   equip: Equipment
  }, 
  data () {
   return {
     child_component: 'equip',
     _list: []
   }
  }
  </code></pre>
  <p>Basically I'm trying to render Equipment, but the dynamic way</p>
  <p>I get 3 errors in console and a blank page</p>
  <blockquote>
  <p>[Vue warn]: Error when rendering component  at /home/victor/projetos/tokaai/public/src/components/EquipmentFormItem.vue:</p>
  <p>Uncaught TypeError: Cannot read property 'name' of undefined</p>
  <p>TypeError: Cannot read property 'setAttribute' of undefined</p>
  </blockquote>
  <p>Apparently I'm doing something wrong</p>