title: FabricJS - Custom type not renders on LoadFromJSON
body: <p>After loading canvas data from JSON, an element with the custom type attribute isn't renders.</p>
  
  <p>Here is <a href="http://jsfiddle.net/redlive/pnkfsvdk/" rel="nofollow noreferrer">jsFiddle</a>.</p>
  
  <p>Steps to reproduce are:</p>
  
  <p>1) Click on SAVE button</p>
  
  <p>2) Mover RED element somewhere</p>
  
  <p>3) Click on RESTORE button</p>
  
  <p>Nothing happens, but if the type attribute is commented out, then everything works just perfect.</p>
  
  <p>Not sure if it's a bug or I forgot to add something...
  Tnx</p>
  
  <p><div class="snippet" data-lang="js" data-hide="true" data-console="false" data-babel="false">
  <div class="snippet-code snippet-currently-hidden">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>fabric.ContainerRect = fabric.util.createClass(fabric.Rect, {
    type: 'container-rect',
    initialize: function(options) {
  
      this.callSuper('initialize', options);
  
      this.on('moving', function() {
        // console.log('Red is moving...');
      });
    },
    _render: function(ctx) {
      this.callSuper('_render', ctx);
    }
  });
  
  fabric.ContainerRect.fromObject = function(options) {
    return new fabric.ContainerRect(options);
  }
  
  //==========================================================================================
  let store;
  const canvas = new fabric.Canvas('paper');
  const canvasOriginalSize = {
    width: 600,
    height: 600
  };
  
  const redBox = new fabric.ContainerRect({
    left: 0,
    top: 0,
    width: 50,
    height: 50,
    fill: 'red'
  });
  
  canvas.add(redBox);
  canvas.renderAll();
  
  
  $("#save").on('click', function() {
    store = canvas.toJSON();
    console.log(store);
  });
  
  $("#restore").on('click', function() {
    canvas.loadFromJSON(store, function() {
      //console.log('restored:', canvas.getObjects());
      //canvas.renderAll();
    });
  });</code></pre>
  <pre class="snippet-code-css lang-css prettyprint-override"><code>#paper {
    border: solid 1px red;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="//cdnjs.cloudflare.com/ajax/libs/fabric.js/2.2.3/fabric.js"&gt;&lt;/script&gt;
  &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"&gt;&lt;/script&gt;
  
  &lt;canvas id="paper" width="400" height="400" style="border:1px solid #ccc"&gt;&lt;/canvas&gt;
  &lt;button id="save"&gt;Save to JSON&lt;/button&gt;
  &lt;button id="restore"&gt;Restore form JSON&lt;/button&gt;</code></pre>
  </div>
  </div>
  </p>