title: defaultActiveKey prop of antd tabs not working in Array.map
body: <p>I am trying to set the <code>defaultActiveKey</code> for <strong>antd tabs</strong>. I tried like this:</p>
  <pre><code>import React, {useState, useEffect} from &quot;react&quot;;
  import { Row, Tabs } from &quot;antd&quot;;
  
  const { TabPane } = Tabs;
  
  const MyComponent = (props) =&gt; {
  
    const [tabs, setTabs] = useState([]);
    const defaultTab = 'tab2';
  
    useEffect(() =&gt; {
      const tabsData = [
        { name: &quot;Tab 1&quot;, key: &quot;tab1&quot; },
        { name: &quot;Tab 2&quot;, key: &quot;tab2&quot; },
        { name: &quot;Tab 3&quot;, key: &quot;tab3&quot; }
      ];
      setTabs(tabsData);
    }, []);
  
    return (
      &lt;React.Fragment&gt;
        &lt;Row&gt;
          &lt;Tabs defaultActiveKey={defaultTab}&gt;
           
            {
              tabs.map(({name, key}) =&gt; (
                &lt;TabPane tab={name} key={key}&gt;
                  Content of {name}
                &lt;/TabPane&gt;
              ))
            }
          &lt;/Tabs&gt;
        &lt;/Row&gt;
      &lt;/React.Fragment&gt;
    );
  };
  </code></pre>
  <p>I want to set <strong>tab2</strong> as the <code>defaultActiveKey</code> but it isn't working. But it's working when I do this:</p>
  <pre><code>&lt;Tabs defaultActiveKey={defaultTab}&gt;
    &lt;TabPane tab={tabs[0].name} key={tabs[0].key}&gt;
      &lt;SomeComponent/&gt;
    &lt;/TabPane&gt;
    &lt;TabPane tab={tabs[1].name} key={tabs[1].key}&gt;
      &lt;SomeComponent/&gt;
    &lt;/TabPane&gt;
    &lt;TabPane tab={tabs[2].name} key={tabs[2].key}&gt;
      &lt;SomeComponent/&gt;
    &lt;/TabPane&gt;
  &lt;/Tabs&gt;
  </code></pre>
  <p>How to solve this?</p>