reactjs / reactjs/react-tabs

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

Open
#581 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
3.1k
Forks
455
Avg merge
5h 9m
Merged PRs (30d)
2

Description

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.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the UncontrolledTabs component and inspect the default-props object spread, reproducing the case where props.className is explicitly undefined. Confirm the intended behavior for the default "react-tabs" class and verify that the class remains applied without breaking an explicitly supplied className.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, react
Domain
frontend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.