Skip to content

Fix IntrinsicAttributes error in TypeScript definitions #304

@metonym

Description

@metonym

This error has appeared several times now: #253, #300, #303


Component props should be typed as the intersection of the semantic element props and props exported from the component.

Furthermore, potentially adding { [key: string]: any; } can serve as a catch-all for custom component attributes. A common use case would be data-{X} selectors used for testing/analytics.

For example, the following should not throw a TS error:

<Link data-test style="color: red;" href="#">Link</Link>

The data-test and style attributes are not explicitly defined in the Link component, but they should still be valid.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions