title: How to pass the object as a input in text field. and get it object
body: <p>This is my Initial state. I want add 1 json as a input and want to push  key and value to the initial state?</p>
  <pre><code>const[state,setState] = useState({
   id: &quot;1440&quot;
   dev: &quot;admin&quot;
   cmd: 5
   agu: {}
  })
  </code></pre>
  <p>I have one JSON data. I need to pass this as a Input in Text field and get it back like JSON Objects.
  Now I am getting the type as string</p>
  <p>sample JSON</p>
  <pre><code>  {
    key1:&quot;val1&quot;,
    key2:&quot;val2&quot;,
    key3:&quot;val3&quot;,
    key4:&quot;val4&quot;,
    key5:&quot;val5&quot;,
    key6:&quot;val6&quot;,
    key7:&quot;val7
    }
  </code></pre>
  <p>and I want the output as like</p>
  <pre><code>const[state,setState] = useState({
       id: &quot;1440&quot;
       dev: &quot;admin&quot;
       cmd: 5
       agu: {
           key1: &quot;val1&quot;
           key2: &quot;val2&quot;
           key3: &quot;val3&quot;
           key4: &quot;val4&quot;
           key5: &quot;val5&quot;
           key6: &quot;val6&quot;
           key7: &quot;val7
       }
      })
  </code></pre>
  <p>How can I achieve this. anyone have ideas please share with me</p>