You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
className default is lost when props.className is undefined in UncontrolledTabs #581
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.
Hi, thanks for the clear report.
I’m interested in working on this, but wanted to confirm expected behavior before proposing a fix:
Should the default className be preserved when props.className is undefined?
Or is the current behavior intentional, and the fix would require guarding against explicit undefined overrides?
Depending on the answer, I can propose a backward-compatible fix and add tests.
Thanks for confirming! I’ll work on a fix that preserves the default className when props.className is null or undefined, and add tests to cover this behavior.
Activity
Shiva903-hue commentedon Jan 13, 2026
Hi, thanks for the clear report.
I’m interested in working on this, but wanted to confirm expected behavior before proposing a fix:
Should the default
classNamebe preserved whenprops.classNameisundefined?Or is the current behavior intentional, and the fix would require guarding against explicit
undefinedoverrides?Depending on the answer, I can propose a backward-compatible fix and add tests.
danez commentedon Jan 13, 2026
It is inteded that when the
classNameis set to a string it should overwrite. If it is set to undefined and null it should not.Shiva903-hue commentedon Jan 14, 2026
Thanks for confirming! I’ll work on a fix that preserves the default className when props.className is null or undefined, and add tests to cover this behavior.