facebook/react — pull request #1989 by syranide (2014-08-03 23:07:58+00:00)
Title: Merge adjacent ReactTextComponents in flattenChildren

Includes #1988 (so ignore changes to traverseAllChildren, only lines with `previousName` are new).

This PR is a super simple isolated implementation for merging adjacent ReactTextComponents just before rendering. So this does *not* affect `this.props.children` or `cloneWithProps`. It's currently not re-entrant, it is really easy to fix simply by storing it in a magic key inside `traverseContext` instead, but that doesn't seem worth it.

With this and something like #1570 we should be able to get rid of all excess markup for text.

Massively increased test-coverage for `ReactMultiChildText`.