title: Uncaught TypeError: Cannot read property 'getParent' of undefined
body: <p>the component create (drawer antd):</p>
  
  <pre><code>export default class Cadastrar extends React.Component {
      state = {
          visible: true,
      }
  
  
      showDrawer = () =&gt; {
          this.setState({
              visible: true,
          })
      }
  
      closeDrawer = () =&gt; {
          this.setState({
              visible: false,
          })
      }
  
      render() {
          return (
              &lt;&gt;
                  &lt;Drawer
                      title="Create a new account"
                      width={720}
                      onClose={this.closeDrawer}
                      visible={this.state.visible}
                      bodyStyle={{ paddingBottom: 80 }}
                      footer={
                          &lt;div
                              style={{
                                  textAlign: 'right',
                              }}
                          &gt;
                              &lt;Button
                                  onClick={this.closeDrawer}
                                  style={{ marginRight: 8 }}
                              &gt;
                                  Cancel
                              &lt;/Button&gt;
                              &lt;Button onClick={this.closeDrawer} type="primary"&gt;
                                  Submit
                              &lt;/Button&gt;
                          &lt;/div&gt;
                      }
                  &gt;
                     teste
                  &lt;/Drawer&gt;
              &lt;/&gt;
          )
      }
  }
  </code></pre>
  
  <p>the index users:</p>
  
  <pre><code>export default class Usuarios extends React.Component {
      render() {
          const columns = [...]
  
          const data = [...]
  
          return (
              &lt;React.Fragment&gt;
                  &lt;Row gutter={16} className="box-actions"&gt;
                      &lt;Col className="gutter-row" span={18} align="start"&gt;
                          {' '}
                          &lt;Button
                              type="primary"
                              onClick={() =&gt; {
                                  this.refs.cadastrar.showDrawer()
                              }}
                          &gt;
                              Cadastrar
                          &lt;/Button&gt;
                      &lt;/Col&gt;
                      &lt;Col className="gutter-row" span={6}&gt;
                          &lt;Search
                              placeholder="Buscar..."
                              onSearch={value =&gt; console.log(value)}
                          /&gt;
                      &lt;/Col&gt;
                  &lt;/Row&gt;
                  &lt;Table columns={columns} dataSource={data} /&gt;
                  &lt;Cadastrar ref="cadastrar" /&gt;
              &lt;/React.Fragment&gt;
          )
      }
  }
  </code></pre>
  
  <p>note:
  the component:</p>
  
  <pre><code>&lt;Cadastrar ref="cadastrar" /&gt; 
  </code></pre>
  
  <p>is called by </p>
  
  <pre><code>&lt;Button
     type="primary"
     onClick={() =&gt; {
       this.refs.cadastrar.showDrawer()
     }}
  &gt;
  </code></pre>
  
  <p>the error:</p>
  
  <pre><code>PortalWrapper.js?d56f:236 Uncaught TypeError: Cannot read property 'getParent' of undefined
      at getDerivedStateFromProps (PortalWrapper.js?d56f:236)
      at applyDerivedStateFromProps (react-dom.development.js:12603)
      at updateClassInstance (react-dom.development.js:13207)
      at updateClassComponent (react-dom.development.js:17107)
      at beginWork (react-dom.development.js:18620)
      at HTMLUnknownElement.callCallback (react-dom.development.js:188)
      at Object.invokeGuardedCallbackDev (react-dom.development.js:237)
      at invokeGuardedCallback (react-dom.development.js:292)
      at beginWork$1 (react-dom.development.js:23203)
      at performUnitOfWork (react-dom.development.js:22154)
      at workLoopSync (react-dom.development.js:22130)
      at performSyncWorkOnRoot (react-dom.development.js:21756)
      at react-dom.development.js:11089
      at unstable_runWithPriority (scheduler.development.js:653)
      at runWithPriority$1 (react-dom.development.js:11039)
      at flushSyncCallbackQueueImpl (react-dom.development.js:11084)
      at flushSyncCallbackQueue (react-dom.development.js:11072)
      at discreteUpdates$1 (react-dom.development.js:21893)
      at discreteUpdates (react-dom.development.js:806)
      at dispatchDiscreteEvent (react-dom.development.js:4168)
  getDerivedStateFromProps @ PortalWrapper.js?d56f:236
  applyDerivedStateFromProps @ react-dom.development.js:12603
  updateClassInstance @ react-dom.development.js:13207
  updateClassComponent @ react-dom.development.js:17107
  beginWork @ react-dom.development.js:18620
  callCallback @ react-dom.development.js:188
  invokeGuardedCallbackDev @ react-dom.development.js:237
  invokeGuardedCallback @ react-dom.development.js:292
  beginWork$1 @ react-dom.development.js:23203
  performUnitOfWork @ react-dom.development.js:22154
  workLoopSync @ react-dom.development.js:22130
  performSyncWorkOnRoot @ react-dom.development.js:21756
  (anonymous) @ react-dom.development.js:11089
  unstable_runWithPriority @ scheduler.development.js:653
  runWithPriority$1 @ react-dom.development.js:11039
  flushSyncCallbackQueueImpl @ react-dom.development.js:11084
  flushSyncCallbackQueue @ react-dom.development.js:11072
  discreteUpdates$1 @ react-dom.development.js:21893
  discreteUpdates @ react-dom.development.js:806
  dispatchDiscreteEvent @ react-dom.development.js:4168
  react_devtools_backend.js:6 The above error occurred in the &lt;PortalWrapper&gt; component:
      in PortalWrapper (created by DrawerWrapper)
      in DrawerWrapper (created by Context.Consumer)
      in Drawer (created by Context.Consumer)
      in withConfigConsumer(Drawer) (at teste.js:23)
      in Teste (at teste/index.js:9)
      in Index (at _app.js:49)
      in main (created by Basic)
      in Basic (created by Context.Consumer)
      in Content (at _app.js:48)
      in section (created by Context.Consumer)
      in BasicLayout (created by Context.Consumer)
      in Layout (at _app.js:30)
      in section (created by Context.Consumer)
      in BasicLayout (created by Context.Consumer)
      in Layout (at _app.js:28)
      in AppLayout
      in ErrorBoundary (created by ReactDevOverlay)
      in ReactDevOverlay (created by Container)
      in Container (created by AppContainer)
      in AppContainer
      in Root
  
  React will try to recreate this component tree from scratch using the error boundary you provided, ErrorBoundary.
  </code></pre>
  
  <p>I was using it in the same way with razzle, but when I migrated to nextjs, it presented this error</p>
  
  <p>code with next:
  <a href="https://gitlab.com/henriquezolini/next-antdesign" rel="nofollow noreferrer">https://gitlab.com/henriquezolini/next-antdesign</a> (has errors)</p>
  
  <p>code with Razzle:
  <a href="https://gitlab.com/henriquezolini/razzle-ant-design" rel="nofollow noreferrer">https://gitlab.com/henriquezolini/razzle-ant-design</a> (works)</p>