You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Strange thing: <ParsedText ...>{a} {b}</ParsedText>
does not get parsed but <ParsedText ...>{a + ' ' + b}</ParsedText>
does.
I don't know if it's a bug or if I'm doing something wrong.
Many thanks!
The text was updated successfully, but these errors were encountered:
The problem probably is that for react {a} {b} translates to three children like so ['a', ' ', 'b'] and {a + ' ' + b} is only one child which is just a simple string not an array of strings. I think the code is assuming that you have only one child inside <ParsedText>. I'm not sure that that's a bug tho. And you are not doing anything wrong for sure.
This is a limitation of how React works. Depending on your exact code, I'd say you could use the latter pattern that you suggested in your issue description.
If you want, you can make a special component that uses the React.Children APIs to concatenate all the strings for you into a single component.
I'm going to close this ticket as it's over 2 years old, but if you think you still want to discuss it, we can reopen!
If you find a bug or have a PR, I'm working on a new release in #79
Strange thing:
<ParsedText ...>{a} {b}</ParsedText>
does not get parsed but
<ParsedText ...>{a + ' ' + b}</ParsedText>
does.
I don't know if it's a bug or if I'm doing something wrong.
Many thanks!
The text was updated successfully, but these errors were encountered: