Produced DOM is bloated with react-text
See original GitHub issueIn the demo, if we use even simple hey
element, DOM gets bloated with react-text
.

It it possible to avoid this?
Issue Analytics
- State:
- Created 6 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
Bloated Stomach: Causes, Tips to Reduce & When to be ...
A bloated stomach feels tight, full and often painful. It's usually a digestive issue, but hormones and stress also play a part.
Read more >Conditionally rendering components, but code is bloated with ...
I'm refactoring my code as it was bloated with multiple if else statements & states. My issue is the use of states &...
Read more >Why Is My Stomach Bloated? 15 Causes of Abdominal Bloating
Most people who think they're bloated because they have gas are just more sensitive to it. ... That can produce gas and lead...
Read more >Avoiding Babel's Production Bloat | by Andrea Giammarchi
This post is about the sometime inevitable bloat transpilers bring in, ... Another lovely, and inevitable, code bloat is generated by array destructuring:...
Read more >Bloating - Bloated Stomach - What Causes Bloating?
Some foods produce more gas than others. It can also be caused by lactose intolerance (problems with dairy). Other simple reasons for bloating ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
The jsBin that @VladShcherbin linked does not produce
react-text
because ES6 string interpolation is being used so thatReact.createElement
is provided a single child element.React.createElement
wraps child elements inreact-text
when an array is passed into it’s children arg (even if the array only contains 1 element). As far as I can tell, this behavior is only necessary when an element contains multiple children and has no positive impact on single-child elements.Simply reducing the children array to a single value if it only contains a single element should avoid most of unnecessary
react-text
comments.Those things are here because React server side API is used (to generate html, no just DOM manipulation). This is not an issue but anyway, this will go await with React 16.