title: React: AutoFocus on Input field inside Modal
body: <p>I use Antd. I have Modal Window which consist Form. I want to focus in Input Field when user open the modal widnow. How i can do it in functional component? I try this but in not work for me:</p>
  <pre><code>
  const EditForm = ({visible, widget, onSave, onCancel}) =&gt; {
    const nameInput = useRef();
    useEffect(() =&gt; nameInput.current &amp;&amp; nameInput.current.focus());
    const [form] = Form.useForm();
     return (
      &lt;div&gt;
        &lt;Modal
          visible={visible}
          title='Edit'
          okText='Save'
          cancelText='Cancel'
          onCancel={onCancel}
          onOk={() =&gt; {
            form
              .validateFields()
              .then(values =&gt; {
                form.resetFields();
                onSave(values);
              })
              .catch(info =&gt; {
                console.log('Validate Failed:', info);
              });
          }}
        &gt;
          &lt;Form
            {...formItemLayout}
            layout={formLayout}
            form={form}
          &gt;
            &lt;Form.Item /&gt;
            &lt;Form.Item
              name='nameWidget'
              label='Name'
            &gt;
              &lt;Input name='nameWidget' ref={nameInput} onChange={handleChangeName} placeholder='Введите новое название' /&gt;
            &lt;/Form.Item&gt;
  
          &lt;/Form&gt;
        &lt;/Modal&gt;
      &lt;/div&gt;
    );
  };
  </code></pre>