title: React Hooks: Cannot assign to read only property
body: <p>I am trying to update an object created with React.createElement(). The property I am trying to update is <code>particleCopy.props.style.top</code>. Below is my code.</p>
  
  <pre class="lang-js prettyprint-override"><code>import React, { useState } from 'react';
  import './Particles.scss';
  
  export default function Particles() {
    const particleStyle = { color: 'blue', position: 'absolute', top: '0px' };
    const [particle, setParticle] = useState(
      React.createElement('div', { style: particleStyle }, '*')
    );
  
    const moveParticleDown = (particle, top) =&gt; {
      const particleCopy = Object.assign({}, particle);
      particleCopy.props.style.top = top + 'px';
      setParticle(particleCopy);
    };
  
    return (
      &lt;div className="particles_container"&gt;
        &lt;div className="particles"&gt;{particle}&lt;/div&gt;
        &lt;div className="controls"&gt;
          &lt;button onClick={() =&gt; moveParticleDown(particle, 10)}&gt;down&lt;/button&gt;
        &lt;/div&gt;
      &lt;/div&gt;
    );
  }
  </code></pre>
  
  <p>I am getting the following error</p>
  
  <p><code>Uncaught TypeError: Cannot assign to read only property 'top' of object '#&lt;Object&gt;'</code></p>