Update Tabs.md

The function name and argument were wrong, probably remains of some old version. 
If you update this code also on the CodePen project, it will print to the console, like intended
This commit is contained in:
Tomer
2021-08-05 13:39:41 +03:00
committed by GitHub
parent ee30212d67
commit fd96983b7a

View File

@ -45,7 +45,7 @@ const TabItem = props => <div {...props} />;
const Tabs = ({ defaultIndex = 0, onTabClick, children }) => {
const [bindIndex, setBindIndex] = React.useState(defaultIndex);
const changeTab = newIndex => {
if (typeof onItemClick === 'function') onItemClick(itemIndex);
if (typeof onTabClick === 'function') onTabClick(newIndex);
setBindIndex(newIndex);
};
const items = children.filter(item => item.type.name === 'TabItem');