title: Edit/Update input field with React
body: <p>I'm new to react and I'm trying to edit an input field after I prefilled its value with an object value from my database, so what should I put on onChange if value is value={data.info}? because I cannot type or change the initial value. I've watched a lot of tutorials but this. and props are very confusing to me</p>
  <pre><code>import React, { useState } from 'react';
  import { useParams } from 'react-router-dom';
  import useAsync from '../useAsync';
  
  export default function Details() {
    const url = 'https://..';
    const { index } = useParams();
    const { data } = useAsync(url + index);
    const [state, setState] = useState(false);
  
  
  
  const showForm = () =&gt; {
      return (
          &lt;div&gt;
              &lt;form&gt;
                  &lt;input type=&quot;text&quot; value={data.info} onChange={} /&gt;
              &lt;/form&gt;
          &lt;/div&gt;
      )
  }
  
  
  return (
      &lt;div className=&quot;details&quot; &gt;
          {data &amp;&amp; &lt;p key={index}&gt;{data.info}&lt;/p&gt;}
          &lt;button onClick={() =&gt; setState({ showForm: true })}&gt;Edit&lt;/button&gt;
          {state.showForm ? showForm() : null}
      &lt;/div&gt;
  )
  </code></pre>
  <p>}</p>