Skip to content

className default is lost when props.className is undefined in UncontrolledTabs #581

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
benjaminliugang opened this issue May 28, 2025 · 0 comments

Comments

@benjaminliugang
Copy link

In the UncontrolledTabs component, default props are merged using object spreading:

const { className, ...attributes } = { ...defaultProps, ...props, };

Even the defaultProps.className is defined ('react-tabs') and props.className is explicitly undefined, the spread operation will overwrite the default and set className to undefined.

As a result, the default class name is lost. It's unclear whether this behavior is intended, but it can lead to unexpected issues, especially when upgrading from older versions where the default class was always applied. Projects relying on the default 'react-tabs' class for styling or selectors may break silently.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant