title: Gutenberg media upload in Inspect Controls
body: <p>I am trying to upload the file via Media Library from Inspect Control in Gutenberg. I am using this code currently in JS :</p>
  
  <pre><code>var el = wp.element.createElement,
      registerBlockType = wp.blocks.registerBlockType,
      ServerSideRender = wp.components.ServerSideRender,
      TextControl = wp.components.TextControl,
      TextareaControl = wp.components.TextareaControl,
      MediaUpload = wp.components.MediaUpload,
      InspectorControls = wp.editor.InspectorControls;
  </code></pre>
  
  <p>And here I am registering the block type :</p>
  
  <pre><code>    registerBlockType( 'myplugin/about-section', {
          title: 'About Section',
          icon: 'megaphone',
          category: 'widgets',
          edit: function( props ) {
              return [
                  el( ServerSideRender, {
                      block: 'malinda/about-section',
                      attributes: props.attributes,
                  } ),
  
                  el( InspectorControls, {},
                      el( MediaUpload, {
                          label: 'Background Image',
                          value: props.attributes.bgimg,
  // I think something need to be done here..
                      } ),
                  ),
              ];
          },
          save: function() {
              return null;
          },
      } );
  </code></pre>
  
  <p>But for some reason it's not working for me. In console it's giving me this error : </p>
  
  <blockquote>
    <p>Error: Minified React error #130; visit
    <a href="https://reactjs.org/docs/error-decoder.html?invariant=130&amp;args[]=undefined&amp;args[]=" rel="nofollow noreferrer">https://reactjs.org/docs/error-decoder.html?invariant=130&amp;args[]=undefined&amp;args[]=</a>
    for the full message or use the non-minified dev environment for full
    errors and additional helpful warnings.</p>
  </blockquote>
  
  <p>and when I click on block it says : </p>
  
  <blockquote>
    <p>The editor has encountered an unexpected error.</p>
  </blockquote>
  
  <p>Can anyone please help me in that?</p>