Is it possible to create a decorator component consisting of multiple elements where each element contains a substring of the original decorated text?
E.g. the string *Hello* gets matched and a decorator is created. Now I want to render the "*"characters in a different color.
I was able to render a component consisting of 3 spans with different styles and substrings of "props.decoratedText". The problem is that the selection is screwed up - because I'm not rendering "props.children" inside the decorator.
Hi!
Is it possible to create a decorator component consisting of multiple elements where each element contains a substring of the original decorated text?
E.g. the string
*Hello*
gets matched and a decorator is created. Now I want to render the"*"
characters in a different color.I was able to render a component consisting of 3 spans with different styles and substrings of "props.decoratedText". The problem is that the selection is screwed up - because I'm not rendering "props.children" inside the decorator.
Is there a way to split up the decorator text?