Mojang / ore-ui

💎 Building blocks to construct game UIs using web tech.
https://react-facet.mojang.com/
MIT License
409 stars 18 forks source link

Add tests / docs of index as argument of children function in Map component #25

Closed xaviervia closed 2 years ago

xaviervia commented 2 years ago

Currently, the <Map> component will send a Facet containing each item value and a number that is the index of that item to the function that it receives as children. So:

<Map array={useFacetWrap(['alpha', 'beta', 'gamma'])}>
  {(item, index) => { /* ... */ }}
</Map>

The fact that this index is sent as the second argument is currently not documented and not tested anywhere.