title: One time action in React Components
body: <p>I have a question regarding "one time actions" in react components. Imagine for example I want to scroll some element to certain position, or reset the internal react state. </p>
  
  <p>So far I've been doing this by using a combination of a boolean flag (e.g. <code>doAction: true</code>) and an update action (e.g. <code>setDoActionBackToFalse</code>), but this seems too complex. Does anyone have any nice solution to this?</p>
  
  <p>Note: The action can actually happen multiple times during the lifetime of the component but each time it has to be specifically triggered and happen only once (not keep happening on every rerender). E.g. scroll to every newly added item in scrollpane.</p>
  
  <p>I created small fiddle to make the problem more obvious:
  <a href="https://jsfiddle.net/martinkadlec/et74rkLk/1/" rel="noreferrer">https://jsfiddle.net/martinkadlec/et74rkLk/1/</a>
  This uses the boolean flag approach.</p>