question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Produced DOM is bloated with react-text

See original GitHub issue

In the demo, if we use even simple hey element, DOM gets bloated with react-text.

screen shot 2017-04-07 at 8 49 28 pm

It it possible to avoid this?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

3reactions
quoerademcommented, Jun 22, 2017

The jsBin that @VladShcherbin linked does not produce react-text because ES6 string interpolation is being used so that React.createElement is provided a single child element.

React.createElement wraps child elements in react-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.

1reaction
MoOxcommented, Sep 8, 2017

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found