Make text/HTML to accept children instead
renatoi opened this issue · comments
Renato Iwashima commented
It would be a lot better if this component could accept children instead of having 2 versions, one for text and another for HTML (with unsafe stuff).
This should be possible:
<Ellipsis
maxLine='3'
ellipsis='...'
trimRight
basedOn='letters'
>
<span>Foo</span> bar!
</Ellipsis>
xiaody commented
I don't think it's possible to accept dynamic React nodes as HTML input. Clamping and React nodes rendering would definitely conflict on operating the DOM. If we plan to just handle static stuff, it's no difference using a prop or children.