Closed mannyhenri closed 7 years ago
My 2c, flex box can potentially be valuable when creating interfaces for the user to interact with in a VR app. It might be easier to use the flex box API than trying to align items in a menu.
@matthamil I don't disagree with its web capabilities and how it could be used in the text component for example. But for 3D environments with 3D objects there shouldn't be any automatic positioning system in place, flexbox or otherwise, so we can "absolutely" position our models. Imagine how we would handle animations for example. If ReactVR is to become a leading VR/3D package it needs to approach its library with 3D environment best practices. And that is my perspective from a guy who develops and works with Unreal and 3D packages like Zbrush/Maya but who also develops on the web. Flexbox is great for web, but needs to be disabled for 3D.
A better approach would be to enable it on the text component, or create a flexbox component we we could wrap other elements inside of it. So we have the options to use it or not.
All, I relabeled the issue so it makes more sense what is the issue here.
You can still place things without flexbox using position: absolute
The first example in the docs shows how you can position things without worrying about flexbox. So the flexbox support is totally optional for when you want to use it.
@mannyhenri Perhaps adding resources about Best Practices in VR to the documentation would be a better approach than removing flexbox altogether? Removing flexbox support would mean using a forked version of React Native as a dependency (if this is incorrect I apologize), which wouldn't be ideal for a library as new as this one.
FWIW ReactVR was also introduced with a real use-case for flexbox in VR
The design of React VR is to use flex by default for all components that it makes sense on, those that don't need automatic layout use position : 'absolute'
. We won't be removing flexbox but if there are incorrect defaults there is a reason to change those as part of a breaking change.
flexbox is an automatic layout system, layout is in part a transform and position gives you a chance to take control.
In my opinion, I don't believe the coordinate system for placing 3D objects should be impacted by flexbox at all, as when you place multiple 3D objects in a scene everything needs to be repositioned constantly. I know there is the position: absolute fix but when doing 3D we shouldn't have web layout impacting these items, as it makes it hard to manage transforms or transforms derived from animation. The fix is fine for now, but makes no sense why we would need flexbox in a 3D environment. Flexbox is amazing for web, but makes no sense for 3D/VR.