davidtheclark / davidtheclark/react-aria-tabpanel

Id not being passed to the onChange function

Open
#14 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
121
Forks
28
PR merge metrics
No merged PRs in 30d

Description

Hi @davidtheclark! The library is great, thank you for open sourcing it!

I have been running into one issue. I was trying to replicate the stateless demo, and can get the tabs to switch. But the function being passed as the `onChange` prop is not being passed the `id` on `tabChange`. I imagine it is a n00b mistake, but any pointers would me much appreciated.

Here is what my render function works like -

``` javascript
return (



    {renderTabHeadings()}



{renderTabContents()}


);
```

The `handleTabChange` function is not getting the `tabId` parameter. This is what that looks like:

``` javascript
handleTabChange = (newActiveTabId) => {
//TODO: change router here when updated
console.log(newActiveTabId); //is always undefined :(
};
```

Thank you!

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.