From fd96983b7a503d20ef0645fb6d264c2a437e02d8 Mon Sep 17 00:00:00 2001 From: Tomer Date: Thu, 5 Aug 2021 13:39:41 +0300 Subject: [PATCH] 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 --- snippets/Tabs.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/snippets/Tabs.md b/snippets/Tabs.md index 71807a657..dbb7a0641 100644 --- a/snippets/Tabs.md +++ b/snippets/Tabs.md @@ -45,7 +45,7 @@ const TabItem = 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');