title: How to change Antd form initialValues depends at url or id?
body: <p>I got same component with Antd form for add/edit article. With pathes in router</p>
  <pre><code>&lt;Route path=&quot;/add&quot; component={ !currentUser ? Login : ArticleEditor } /&gt;
  &lt;Route path=&quot;/article/:id/edit&quot; component={ !currentUser ? Login : ArticleEditor } /&gt;
  </code></pre>
  <p>When I click &quot;edit&quot; button I add initialValues to form, than if I click &quot;Create new article&quot; url changes to &quot;/add&quot;, but form didn't update values. Values remains from edited article. How to update form values? Tried to set initialValues depends at path, or &quot;id&quot; but its not worked. How to update antd form values in that case?</p>
  <pre><code>const initialValues = this.props.location.pathname === '/add' ? {} : {
        title: this.props?.title,
        body: this.props?.body,
        description: this.props?.description
      };
  </code></pre>
  <p>Here you can see the component code - <a href="https://codesandbox.io/s/zen-darkness-49oeq?file=/src/components/Articles/ArticleEditor.js" rel="nofollow noreferrer">codesandbox link</a></p>