react.dev icon indicating copy to clipboard operation
react.dev copied to clipboard

React.Children.map function signature

Open thisguycodes opened this issue 7 years ago • 4 comments

Currently documented as: React.Children.map(children, function[(thisArg)])

What's this function[(thisArg)] <--

I don't spend a ton of time in javascript, but I can't find anything that indicates this is what's meant to go here.

The actual signature seems more like: React.Children.map(children, function, thisArg)

thisguycodes avatar Dec 30 '18 02:12 thisguycodes

Also, it would be nice to document the signature of the callback function that is passed to React.Chilren.map.

Right now, the only documentation available is a comment in the React codebase:

The provided mapFunction(child, key, index) will be called for each
leaf child.

Which, apparently, is not even correct (there is no longer the key parameter).

azangru avatar Jan 06 '19 13:01 azangru

Can you confirm this is still an issue?.

praizerema avatar Aug 07 '23 19:08 praizerema

The documentation look ok to me now.

azangru avatar Aug 07 '23 21:08 azangru

Me too. Since there has been no activity for a long while, let's close the issue for now and re-open it if needed.

praizerema avatar Aug 07 '23 23:08 praizerema