Programmatically Changing Tabs Component Issue
Hi, I am having a problem with your React library changinging the tabs programatically, this example in the react docs does not work. The onActiveTab property doesn't exist and i get an error that I can put a useRef on functional component.
const Tabs: FC = () => {
const [activeTab, setActiveTab] = useState
const tabsRef = useRef
return (
<>
aria-label="Default tabs"
style="default"
ref={tabsRef}
onActiveTabChange={tab => setActiveTab(tab)}
<Tabs.Item active title="Profile">
Profile content
</Tabs.Item>
<Tabs.Item title="Dashboard">Dashboard content</Tabs.Item>
<Tabs.Item title="Settings">Settings content</Tabs.Item>
<Tabs.Item title="Contacts">Contacts content</Tabs.Item>
</Tabs.Group>
<Button.Group>
<Button color="gray" onClick={() => tabsRef.current?.setActiveTab(0)}>
Profile
<Button color="gray" onClick={() => tabsRef.current?.setActiveTab(1)}>
Dashboard
<Button color="gray" onClick={() => tabsRef.current?.setActiveTab(2)}>
Settings
<Button color="gray" onClick={() => tabsRef.current?.setActiveTab(3)}>
Contacts
</Button.Group>
</>
);
};
Please follow the bug report template. I don't know what is expected, I don't know the version that you are using. Also, the code that you pasted is unreadable. Can you please add some format to it? I want to help, but it needs to be two-way. :)
Hi there, let us know if you're still having this issue, and please use the provided template for bug reports, it makes it easier for everybody.