Skip to content

Conversation

@AlexandrHoroshih
Copy link
Member

variant blocking on "incompatible props" use-case is bad for DX it only protects against bad spreads, which are antipattern anyway

`variant` blocking on "incompatible props" use-case is bad for DX
it only protects against bad spreads, which are antipattern anyway
@AlexandrHoroshih AlexandrHoroshih marked this pull request as ready for review June 16, 2025 11:45

This comment was marked as outdated.

@AlexandrHoroshih AlexandrHoroshih requested a review from Copilot June 16, 2025 12:01
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR relaxes the variant type behavior so that incompatible props across cases are allowed, updating the tests to reflect the new union-based prop requirements and error conditions.

  • Replace strict expectType<React.FC> checks with direct JSX usage to validate relaxed prop constraints
  • Add positive and negative usage examples for various variant configurations
  • Remove unnecessary blocking of incompatible props between cases
Comments suppressed due to low confidence (2)

type-tests/types-variant.tsx:34

  • The original expectType<React.FC>(VariableInput) assertion was removed here, which loses an explicit check that VariableInput is a React functional component. Consider re-adding an expectType assertion to maintain coverage on component shape.
<VariableInput />;

type-tests/types-variant.tsx:93

  • Typo in comment: possble should be possible.
// variant allows not to set every possble case

@AlexandrHoroshih AlexandrHoroshih merged commit a91fb94 into master Jun 16, 2025
1 check passed
@AlexandrHoroshih AlexandrHoroshih deleted the fix-variant-types branch June 16, 2025 12:02
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.

3 participants