dillon1000/react
Commit
Browse files 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.
Changed paths2 files
First-parent comparisonsrc/utils/__tests__/onlyChild-test.js AddedA src/utils/onlyChild.js AddedPatch
Files changed
Rendering syntax-highlighted changes…