paragon
paragon copied to clipboard
`Truncate` causes a JS error if a non-string child is passed
https://paragon-openedx.netlify.app/components/truncate/
In Truncate, children is expected to be a string.
However, by not supporting any type (string, node, etc.), we run the risk of having the component being flexible enough for consumers' use cases.
For example, if a consumer wants to bold some text in the paragraph of truncated text, they would not be able to in the current implementation.
Is there a way around this to have Truncate support HTML/React elements in its children? It looks like react-truncate also supports flexible children, maybe as inspiration.