-
-
Notifications
You must be signed in to change notification settings - Fork 447
Closed
Labels
Description
If you specify additional props on the Tabs component they will be forwarded to the rendered div
I looked at your code, i can not use ref, because you use (and overwrite it)
render() {
// Delete all known props, so they don't get added to DOM
const {
children, // unused
className,
disabledTabClassName, // unused
focus, // unused
forceRenderTabPanel, // unused
onSelect, // unused
selectedIndex, // unused
selectedTabClassName, // unused
selectedTabPanelClassName, // unused
...attributes
} = this.props;
return (
<div
{...attributes}
className={cx(className)}
onClick={this.handleClick}
onKeyDown={this.handleKeyDown}
ref={node => {
this.node = node;
}}
data-tabs
>
{this.getChildren()}
</div>
);
}
Can u rewrite code something like
<div
{...attributes}
className={cx(className)}
onClick={this.handleClick}
onKeyDown={this.handleKeyDown}
ref={node => {
this.node = node;
/* ____ ADDED LINE BELOW _____ */
if (attributes.ref) {attributes.ref(node)}
}}
data-tabs
>
{this.getChildren()}
</div>
);