<p dir="auto">It would be nice if I could define an inline style with an array and the parser would expand it to duplicate styles props.  For example:</p>
<p dir="auto">let myStyles = {<br>
display: ['-webkit-flex', '-ms-flexbox', 'flex'],<br>
....<br>
};</p>
<p dir="auto">and then specifying "style={myStyles}" in my component would expand to:</p>
<p dir="auto">style="display: -webkit-flex; display: -ms-flexbox; display: flex"</p>
<p dir="auto">Thanks!</p>
<p dir="auto">Hi there ✋</p>
<p dir="auto">We use react-virtualize to render a list.  A sub component of a row carries some state. This state obviously gets reinitialized on every remount.<br>
Can we just store the state on the parent in object, pass this object down the tree by props and then set this object every time we do a state update?</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="props : {
     stateCache: {
          childState: {} 
     }
}"><pre class="notranslate">props : <span class="pl-kos">{</span>
     <span class="pl-c1">stateCache</span>: <span class="pl-kos">{</span>
          <span class="pl-c1">childState</span>: <span class="pl-kos">{</span><span class="pl-kos">}</span> 
     <span class="pl-kos">}</span>
<span class="pl-kos">}</span></pre></div>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="
constructor(props) {
      super(props)
      this.state = props.stateCache.childState;
}
...
this.setState({property: 2}, () =&gt; this.props.stateCache.childState = this.state)"><pre class="notranslate"><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-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">state</span> <span class="pl-c1">=</span> <span class="pl-s1">props</span><span class="pl-kos">.</span><span class="pl-c1">stateCache</span><span class="pl-kos">.</span><span class="pl-c1">childState</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span>
...
<span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-en">setState</span><span class="pl-kos">(</span><span class="pl-kos">{</span><span class="pl-c1">property</span>: <span class="pl-c1">2</span><span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-c1">=&gt;</span> <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">props</span><span class="pl-kos">.</span><span class="pl-c1">stateCache</span><span class="pl-kos">.</span><span class="pl-c1">childState</span> <span class="pl-c1">=</span> <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">state</span><span class="pl-kos">)</span></pre></div>