Skip to content

fix(segmented-control): type SegmentedControlItem with its declared props interface#1775

Open
te6-in wants to merge 1 commit into
devfrom
fix/segmented-control-item-props-type
Open

fix(segmented-control): type SegmentedControlItem with its declared props interface#1775
te6-in wants to merge 1 commit into
devfrom
fix/segmented-control-item-props-type

Conversation

@te6-in

@te6-in te6-in commented Jul 14, 2026

Copy link
Copy Markdown
Member

Summary by CodeRabbit

  • 개선 사항
    • 세그먼트 컨트롤 항목 컴포넌트의 공개 타입 정의를 정리해 타입 안정성과 개발자 경험을 개선했습니다.
    • 기존 렌더링 및 동작에는 변경이 없습니다.

…rops interface

The forwardRef generic used the narrow UseSegmentedControlItemProps (value/invalid/disabled only)
instead of the declared SegmentedControlItemProps, so children/className/asChild were rejected at
the type level. Runtime behavior is unchanged.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@changeset-bot

changeset-bot Bot commented Jul 14, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 75c897c

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai

coderabbitai Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 6112732e-1cad-46f0-ae66-6478be912ed2

📥 Commits

Reviewing files that changed from the base of the PR and between 74e8595 and 75c897c.

📒 Files selected for processing (1)
  • packages/react-headless/segmented-control/src/SegmentedControl.tsx

📝 Walkthrough

Walkthrough

SegmentedControlItemforwardRef 제네릭이 내부 훅 props 타입에서 공개 컴포넌트 props 타입으로 변경되었습니다. 컨텍스트 조회, props 병합, Provider 및 label 렌더링 로직은 유지되었습니다.

Changes

세그먼트 컨트롤 아이템

Layer / File(s) Summary
공개 props 타입 적용
packages/react-headless/segmented-control/src/SegmentedControl.tsx
SegmentedControlItemSegmentedControlItemProps를 사용하도록 타입 선언을 변경하고, 기존 구현 흐름을 유지합니다.

Estimated code review effort: 1 (Trivial) | ~2 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed SegementedControlItem의 타입을 선언된 props 인터페이스로 변경한 핵심 변경을 정확히 요약합니다.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/segmented-control-item-props-type

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

te6-in added a commit that referenced this pull request Jul 14, 2026
…rops interface

The forwardRef generic used the narrow UseSegmentedControlItemProps instead of
the SegmentedControlItemProps interface declared right above, rejecting
children/className/asChild at the type level while the runtime always spread
them. No runtime change. Same fix as #1775; kept as a standalone commit so a
rebase onto dev drops it automatically.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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

Successfully merging this pull request may close these issues.

1 participant