dequelabs / dequelabs/cauldron
IconButton label prop should be more restrictive
Open
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
Assessment
This issue has not been assessed yet.