Mojang / ore-ui

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

Instantiable Shared Facets #76

Closed xaviervia closed 1 year ago

xaviervia commented 2 years ago

Implements RFC https://github.com/Mojang/ore-ui/issues/65, with some caveats.

Notes:

If we wanted to support onError callback or default value, we would have to add a first argument with an options object, or make sure that useSharedFacet is not variadic and accepts a tuple with the path instead. It seems neither a default value nor the onError handler were required as per the RFC. I did not manage to make the types work with an tuple, so I opted for a variadic API for now.

xaviervia commented 1 year ago

We will most likely not take this approach to address https://github.com/Mojang/ore-ui/issues/65

Closing this for the time being.