Closed bbohlender closed 3 years ago
Is it ready for merge now?
Is it ready for merge now?
Regarding the prettier change, it seems like it's done automatically by the pre-commit pipeline. So I can't remove the prettier change directly. If that's fine, then the PR would be done. 😄 Thank you for your fast responses 👍
Fixes #48
Option to disable the automatic calculation of the bounding box, through the Flex-Element. Allows the developer to talk to the yoga node directly and change the node's size without any rerender from react and gives much more control over the yoga node.
I've also added 3 hooks:
useNode
-> get the yoga nodeuseSetSize
-> set the yoga node size explicitly (usesuseNode
)useSyncGeometrySize
-> synchronize the yoga node size with a mesh explicitly (usesuseSetSize
)useSetSize
anduseSyncGeometrySize
might be very specific, butuseNode
would be required to make these implementations (since I think the context is not exported). Having theuseSyncGeometrySize
hook allows to implement sth. like this:which would then be used inside a flex & box element:
But as soon as someone uses
disableSizeRecalc
he now has to have every element declare its own size explicitly (which is intended in this case).