title: In react, how to read properties and data from object
body: <p>I have table component in react which except generic 'Custom Parameters'. The objective is; I pass the object with data and it convert to URL parameter to pass back to API. for example &quot;&amp;startTime=2020-12-12&amp;endTime=2020-12-30&quot;</p>
  <p>since this table can be used for any component or object so I need to read property &amp; value dynamically.</p>
  <p>now</p>
  <p>I have inteface</p>
  <pre><code> export interface ISearchCriteriaForm{
      startTime: Date,
      endTime: Date,
      LiveTime: Date,
      schedAction_Active: string,
      siteId: number,
      scheduleId: number
    }
  </code></pre>
  <p>In Component I create the instance of ISearchCriteriaForm and assign it a test data.</p>
  <pre><code>const MyComponent = () =&gt; {
  
    const[searchCriteria, setstatusSearchCriteria] = useState&lt;ISearchCriteriaForm&gt; ();
  
  
     const searchCriteria : ISearchCriteriaForm= {
       startTime: new Date(&quot;08/12/2020&quot;),
       endTime: new Date(&quot;09/12/2020&quot;),
       LiveTime: new Date(&quot;10/12/2020&quot;),
       schedAction_Active: &quot;Active&quot;,
       siteId: 1825,
       scheduleId: 3792
    };
  
    setEziStatusSearchCriteria(searchCriteria);
  </code></pre>
  <p>here I need help. I need to read 'searchCriteria' object property name including value so that I can make final string as below. for example the solution read 'startTime' as property and value '08/12/2020' and so on</p>
  <pre><code>    &quot;&amp;startTime=08/12/2020&amp;endTime=09/12/2020&amp;LiveTime=10/12/2020&amp;schedAction_Active=Active&quot;
  </code></pre>