dillon1000/react

Commit

React onlyChild utility.

Small utility that extracts and validates that there is only a single
child passed to a React composite component. The benefit here is that we
abstract away *how* the children are actually stored while we iterate on
different approaches. This way we won't break callsites as we try different
ideas. When we settle on a final approach, all of these callsites will still
work.
Browse files
Changed paths2 files
First-parent comparison
A src/utils/__tests__/onlyChild-test.js AddedA src/utils/onlyChild.js Added
Patch

Files changed

Rendering syntax-highlighted changes…