title: react state initialisation conditional
body: <p>I have a class based component in React-Native where I am initialising few state variables inside the constructor -</p>
  
  <pre><code>constructor(props)
  {
  
  this.state={{
     variable1:0,
     variable2:0
     variable3: this.state.variable1.length&gt;1 &amp;&amp; this.state.variable2.length &gt;1 //Will show error
  }}
  
  }
  </code></pre>
  
  <p>I am trying to initialize variable3 based on the values of variable1 and 2. The current approach will not work as state is not initialized yet.
  What is the best alternative to do this?</p>
  
  <p>Please let me know if I can explain further.</p>