title: Having css property in variable in react hooks
body: <p>I need to remove some properties of html element and add some extra property based on some event.
  I am trying to achieve this by creating one object variable for required css properties and trying to change it at runtime by assigning new object value to css variable.</p>
  <p>Here is the sample code:</p>
  <pre><code>const MyCssVariableSample = (props) =&gt; {
    const [testCssVariable, setTestCssVariable] = useState({
      height: &quot;100%&quot;,
      width: &quot;100%&quot;,
      color: &quot;purple&quot;,
    });
  
    return (
      &lt;div&gt;
        &lt;h1&gt;Welcome&lt;/h1&gt;
        &lt;button
          onClick={() =&gt; {
            setTestCssVariable({
              position: &quot;absolute&quot;,
              bottom: &quot;0&quot;,
              right: &quot;0&quot;,
              color: &quot;purple&quot;,
            }),
          }}
        &gt;Hello there&lt;/button&gt;
        &lt;div className=&quot;xyz&quot;&gt;
          &lt;video id=&quot;abc&quot; style={testCssVariable} /&gt;
        &lt;/div&gt;
      &lt;/div&gt;
    );
  };
  
  </code></pre>
  <p>but I am not able to do so as the code is allowing me to change the value of the defined keys but not introducing keys, so in this case, if I want to change height, width or color then it is fine, but I am not able to introduce position, margin or any other new keys.</p>
  <p>This is the error:</p>
  <blockquote>
  <p>Argument of type '{ position: string; bottom: string; right: string; color: string; }' is not assignable to parameter of type 'SetStateAction&lt;{ height: string; width: string; color: string; &quot;background-color&quot;: string; position: string; bottom: string; right: string; }&gt;'. Type '{ position: string; bottom: string; right: string; color: string; }' is missing the following properties from type '{ height: string; width: string; color: string; &quot;background-color&quot;: string; position: string; bottom: string; right: string; }': height, width, &quot;background-color&quot;</p>
  </blockquote>
  <p>How can I achieve the same? I am very new to react and hooks.</p>