Closed saitonakamura closed 3 years ago
Can't this be renamed to something more specific, such as useFlexCenterAnchor()
?
Or alternatively moved into useFlexSize
Yeah, totally, I was thinking about this too. I like moving it to useFlexSize better (this way it resembles Box children function with the args).
@giulioz , moved it into useFlexSize
hook
Nice! Gotta merge some things and then release
It allows to read centerAnchor prop on a Box, which is useful when positioning something absolutely inside a Box
My usecase - I have a BoxBackground component that need to know size and centerAnchor to position itself correctly. Looks something like this, but now I have to explicitly pass centerAnchor (because I have no way of knowing it)
with this hook (or a render prop) it can be rewritten as