Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ViroButton not compatible with ViroFlexView #255

Open
chaendler opened this issue Apr 27, 2018 · 1 comment
Open

ViroButton not compatible with ViroFlexView #255

chaendler opened this issue Apr 27, 2018 · 1 comment

Comments

@chaendler
Copy link

chaendler commented Apr 27, 2018

Hi,

when i try to use ViroButton together with ViroFlexView inside ViroARScene, i have an error. But according to the documentation, ViroButton can be the child of ViroFlexView. So i'm now confused.


Code:

<ViroFlexView 
style={{flexDirection: 'column', padding: .1}} 
 width={5.0} 
height={5.0} 
position={[0.0, 0.0, -2.0]}
rotation={[0, 45, 0]} >
                  <ViroButton
                    source={require("./res/check.png")}
                    clickSource={require("./res/checked.png")}
                    position={[-1, 0, -1]}
                    height={.5}
                    width={.5}
                    onClick={this._onClick} />
</ViroFlexView>

Error message:

`
ERROR: Only 2D components are allowed in a Flex View container: VRTNodeContainer

-[VRTFlexView insertReactSubview:atIndex:]
VRTFlexView.mm:140
RCTSetChildren
__38-[RCTUIManager setChildren:reactTags:]_block_invoke
__44-[RCTUIManager flushUIBlocksWithCompletion:]_block_invoke
__44-[RCTUIManager flushUIBlocksWithCompletion:]_block_invoke.536
__RCTExecuteOnMainQueue_block_invoke
_dispatch_call_block_and_release
_dispatch_client_callout
_dispatch_main_queue_callback_4CF


CFRunLoopRunSpecific
GSEventRunModal
UIApplicationMain
main

`


Device: iphone 8
Dependencies:
"npm": "^5.8.0",
"react": "16.3.1",
"react-native": "0.55.1",
"react-viro": "2.6.0"

@VikAdvani
Copy link
Contributor

VikAdvani commented Apr 28, 2018

Hi @chaendler, this appears to be a bug on our end. For now as a workaround you can try using a ViroQuad in place of a button. I've added this to our backlog so we can fix it :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants