Skip to content

Conversation

@iNeoO
Copy link
Contributor

@iNeoO iNeoO commented Jul 10, 2025

#434

I believe all valid HTML attributes for a

should be allowed on the Card component.
I removed the type assertion. I'm not sure why it was there in the first place.

@ddecrulle
Copy link
Collaborator

Hello,

Thanks for the proposal.

The type assertion is intentional. It ensures we destructure all props explicitly, so nothing is unintentionally passed via rest. Without this, rest wouldn’t be inferred as never, and we could accidentally miss props without noticing.

We do spread rest onto the <div> to allow custom or non-standard HTML attributes, but that naturally leads to type issues that user needs to explicitly ignore.

To resolve this without compromising type safety, I’d suggest introducing a dedicated prop nativeDivElement. That’s consistent with the pattern we’ve followed elsewhere in the codebase, and it allows us to keep the Equals<keyof rest, never> check valid and meaningful.

@iNeoO
Copy link
Contributor Author

iNeoO commented Jul 10, 2025

Hmm, I'm not really convinced it's worth doing the assertion, but I made the change you asked for.

@ddecrulle ddecrulle merged commit 39888ef into codegouvfr:main Jul 10, 2025
1 check passed
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.

2 participants