title: How to set a value with props?
body: <p>I want to get the initial value from prop, but sometimes prop does not have data Is this the correct way to pass the props ?</p>
  <pre><code>const [brokerId,setBrokerId]=useState(props.data ?props.data.BrokerId :null)
  </code></pre>
  <p>Is there another way?</p>