-
Notifications
You must be signed in to change notification settings - Fork 45.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor React.Children to reduce indirection (#18332)
* Don't pool traversal context * Remove traverseAllChildrenImpl indirection All usages are internal so we can simply use the inner function directly. * Implement forEach through map * Remove second usage of traverseAllChildren This isn't useful by itself but makes the layering easier to follow. traverseAllChildren is only used at the lowest layer now. * Reimplement count() and toArray() in terms of map() * Inline the only use of mapSingleChildIntoContext * Move forEach down in the file * Use the language Get rid of the traversal context. Use closures. * Make mapIntoArray take an already escaped prefix * Move count state out of mapIntoArray * Inline traverseAllChildren into mapIntoArray * Inline handleChild into mapIntoArray
- Loading branch information
Showing
1 changed file
with
91 additions
and
180 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters