title: Block editor giving invalid hook call error
body: <p>I am trying to get the wordpress block editor to load in a react project: <a href="https://www.npmjs.com/package/@wordpress/block-editor" rel="noreferrer">https://www.npmjs.com/package/@wordpress/block-editor</a>.</p>
  <p>I have set it up exactly as per the example on the npm page but it gives an invalid hook error.  I think perhaps it is due to a version mismatch as error suggest?</p>
  <p>This is the code:</p>
  <pre class="lang-js prettyprint-override"><code>import {
    BlockEditorProvider,
    BlockList,
    WritingFlow,
    ObserveTyping
  } from &quot;@wordpress/block-editor&quot;;
  import { SlotFillProvider, Popover } from &quot;@wordpress/components&quot;;
  import { useState } from &quot;@wordpress/element&quot;;
  import &quot;@wordpress/components/build-style/style.css&quot;;
  import &quot;@wordpress/block-editor/build-style/style.css&quot;;
  
  export default function MyEditorComponent() {
    const [blocks, updateBlocks] = useState([]);
  
    return (
      &lt;BlockEditorProvider
        value={blocks}
        onInput={(blocks) =&gt; updateBlocks(blocks)}
        onChange={(blocks) =&gt; updateBlocks(blocks)}
      &gt;
        &lt;SlotFillProvider&gt;
          &lt;Popover.Slot name=&quot;block-toolbar&quot; /&gt;
          &lt;WritingFlow&gt;
            &lt;ObserveTyping&gt;
              &lt;BlockList /&gt;
            &lt;/ObserveTyping&gt;
          &lt;/WritingFlow&gt;
          &lt;Popover.Slot /&gt;
        &lt;/SlotFillProvider&gt;
      &lt;/BlockEditorProvider&gt;
    );
  }
  
  </code></pre>
  <p>And the typical hook error:</p>
  <pre><code>Error
  Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
  1. You might have mismatching versions of React and the renderer (such as React DOM)
  2. You might be breaking the Rules of Hooks
  3. You might have more than one copy of React in the same app
  See [link] for tips about how to debug and fix this problem.
  </code></pre>
  <p>I have setup a codepen to tyr it here: <a href="https://codesandbox.io/s/sleepy-proskuriakova-op59q" rel="noreferrer">https://codesandbox.io/s/sleepy-proskuriakova-op59q</a></p>
  <p>I looked up wordpress version of react and it seems to be 16.6.3 so set that in sandbox and used an older version of react scripts (2.1.8) that at the time was using 16.6.2 but no change in error.  I tried several combinations of versions with no change.</p>
  <p>What is actually causing this error?  How can I get this component to load?</p>