jossmac / jossmac/react-images
ViewType caption typing is incorrect
Open
- Dominant language
- JavaScript
- Stars
- 2.3k
- Forks
- 433
- PR merge metrics
- No merged PRs in 30d
Description
Because of how Captions are rendered by default, the typing of `caption` as `ReactNode` is incorrect. This includes object types like arrays and `React.Component` types. If you try passing one of these as the caption, however, it renders as `[Object object]` rather than rendering properly.
What it should be instead is `string | number | boolean | null | undefined` - the primitive types that react can render. I'll open a PR to fix.
It would be great if we got support in the future for fully dynamic captions using React Components, but for now this is a much quicker fix.
Contributor guide
Assessment
This issue has not been assessed yet.