<p dir="auto">Do you want to request a feature or report a bug?</p>
<p dir="auto">A bug?</p>
<p dir="auto">What is the current behavior?</p>
<p dir="auto">Cannot set property 'memoizedState' of null</p>
<p dir="auto">If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem. Your bug will get fixed much faster if we can run your code and it doesn't have dependencies other than React. Paste the link to your JSFiddle (<a href="https://jsfiddle.net/Luktwrdm/" rel="nofollow">https://jsfiddle.net/Luktwrdm/</a>) or CodeSandbox (<a href="https://codesandbox.io/s/new" rel="nofollow">https://codesandbox.io/s/new</a>) example below:</p>
<p dir="auto">const processLink = html =&gt; {<br>
return renderToStaticMarkup()<br>
};</p>
<p dir="auto">const RichText = ({ html }) =&gt; {<br>
const htmlProcessed = useMemo(() =&gt; processLink(html), [html]);<br>
}<br>
See </p>
<p dir="auto">What is the expected behavior?</p>
<p dir="auto">Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of ### React?</p>
<h2 dir="auto">The current behavior</h2>
<h2 dir="auto">The expected behavior</h2>
<p dir="auto">In terms of performance, is there any difference between using arrow functions and bind manually when using es6 classes? Using arrow functions the methods are not on the class prototype, it will be on the class instance only. Using bind will attach the methods to class prototype. It sounds like bind manually will have better performance, does that mean we should consider using bind instead of arrow functions for class methods?</p>
<p dir="auto">Any suggestions or comments are really appreciated!</p>
<p dir="auto">So in terms of performance, would you recommend using</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="class MyComponent extends React.Component {
  constructor(props) {
    super(props)
  }

  methodA = () =&gt; { ... }
}"><pre class="notranslate"><span class="pl-k">class</span> <span class="pl-v">MyComponent</span> <span class="pl-k">extends</span> <span class="pl-v">React</span><span class="pl-kos">.</span><span class="pl-c1">Component</span> <span class="pl-kos">{</span>
  <span class="pl-en">constructor</span><span class="pl-kos">(</span><span class="pl-s1">props</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
    <span class="pl-smi">super</span><span class="pl-kos">(</span><span class="pl-s1">props</span><span class="pl-kos">)</span>
  <span class="pl-kos">}</span>

  <span class="pl-c1">methodA</span> <span class="pl-c1">=</span> <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-c1">=&gt;</span> <span class="pl-kos">{</span> ... <span class="pl-kos">}</span>
<span class="pl-kos">}</span></pre></div>
<p dir="auto">or</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="class MyComponent extends React.Component {
  constructor(props) {
    super(props)
    this.methodA = this.methodA.bind(this)
  }

  methodA() { ... }
}"><pre class="notranslate"><span class="pl-k">class</span> <span class="pl-v">MyComponent</span> <span class="pl-k">extends</span> <span class="pl-v">React</span><span class="pl-kos">.</span><span class="pl-c1">Component</span> <span class="pl-kos">{</span>
  <span class="pl-en">constructor</span><span class="pl-kos">(</span><span class="pl-s1">props</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
    <span class="pl-smi">super</span><span class="pl-kos">(</span><span class="pl-s1">props</span><span class="pl-kos">)</span>
    <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">methodA</span> <span class="pl-c1">=</span> <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">methodA</span><span class="pl-kos">.</span><span class="pl-en">bind</span><span class="pl-kos">(</span><span class="pl-smi">this</span><span class="pl-kos">)</span>
  <span class="pl-kos">}</span>

  <span class="pl-en">methodA</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> ... <span class="pl-kos">}</span>
<span class="pl-kos">}</span></pre></div>