osuresearch / ui

Ohio State Research UI
https://osuresearch.github.io/ui/main
MIT License
6 stars 3 forks source link

<Chip> component shouldn't support `null` as an input value #81

Closed helloLilyX closed 1 year ago

helloLilyX commented 1 year ago

<Chip>{null}</Chip> shows up as a thin line

McManning commented 1 year ago

This is just typical React component behaviour. null is valid but will render no content. You should ensure that you have content to actually inject into a chip and fallback to a placeholder if you don't, or don't render the chip at all - depending on your particular use case.

E.g.

{value && <Chip>{value}</Chip>}

OR

<Chip>{value ?? 'fallback'}</Chip>