title: Adding canvas inside another canvas: obj.setCoords is not a function( fabric js)
body: <p>Started using fabric.js and trying to add a canvas inside another canvas, so that the top canvas stays constant and I'll add objects to inner canvas. </p>
  
  <p>Here is the snippet of adding a canvas to another canvas.</p>
  
  <pre><code>canvas  = new fabric.Canvas('artcanvas');
  innerCanvas = new fabric.Canvas("innerCanvas");
  canvas.add(innerCanvas);
  </code></pre>
  
  <p>and my html looks like this </p>
  
  <pre><code>&lt;canvas id="artcanvas" width="500" height="500"&gt;&lt;/canvas&gt;
  &lt;canvas id="innerCanvas" width="200" height="200" &gt;&lt;/canvas&gt;
  </code></pre>
  
  <p>Once adding these successfully, what I am going to do is , add the coordinates to the inner canvas, so that it looks like one on another to the end user. </p>
  
  <p>However, ran into the below error for the tried code </p>
  
  <pre><code>    Uncaught TypeError: obj.setCoords is not a function
      at klass._onObjectAdded (fabric.js:6894)
      at klass.add (fabric.js:231)
      at main.js:60
      at fabric.js:19435
      at HTMLImageElement.fabric.util.loadImage.img.onload (fabric.js:754)
  _onObjectAdded @ fabric.js:6894
  add @ fabric.js:231
  (anonymous) @ main.js:60
  (anonymous) @ fabric.js:19435
  fabric.util.loadImage.img.onload @ fabric.js:754
  </code></pre>
  
  <p>Looking at the error message, just went to the line of error and here is what I found in chrome console</p>
  
  <p><a href="https://i.stack.imgur.com/mJlo9.png" rel="noreferrer"><img src="https://i.stack.imgur.com/mJlo9.png" alt="enter image description here"></a></p>
  
  <p>Can someone point the mistake in my codes ?</p>