dequelabs / dequelabs/cauldron

IconButton label prop should be more restrictive

Open
#957 0 comments 0 reactions 0 assignees View on GitHub
breaking
Dominant language
TypeScript
Stars
127
Forks
31
Avg merge
2d 12h
Merged PRs (30d)
8

Description

Currently, the IconButton `label` prop accepts `ReactNode`: https://github.com/dequelabs/cauldron/blob/655da6e04d8fd20a817a8325c5c2f2ce7aa93449/packages/react/src/components/IconButton/index.tsx#LL24C14-L24C14

This is more permissive than it should be. It's important that the label contain valid content and not `null | undefined | boolean`. We should update the `label` prop type to be `ContentNode`: https://github.com/dequelabs/cauldron/blob/655da6e04d8fd20a817a8325c5c2f2ce7aa93449/packages/react/src/types.ts#L9-L18

Note: This would be a breaking change

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.