ReactVision / viro

ViroReact: The AR and VR library for React Native 📳💙💛🤍💚
MIT License
1.41k stars 164 forks source link

fix(ViroBase): fix onClick not working for <ViroText /> components #277

Closed robertjcolley closed 8 months ago

robertjcolley commented 8 months ago

onClick was being sent to the native code as a prop incorrectly. This forces it to undefined, since we use the onClickViro to pass the onClick function to the native iOS code. I will note that other props not defined on ViroBase were not causing this crash, it was specific to onClick.

resolves #272

mattdfuchs commented 6 months ago

@robertjcolley - I hate to say it, but I'm having the exact same problem in 2.41.1, but with ViroFlexView. The exact error is:

Error setting property 'onClick' of VRTFlexView with tag #349: Error setting property 'onClick' of VRTFlexView with tag #545: Exception thrown while executing UI block: -[VRTFlexView setOnClick:]: unrecognized selector sent to instance 0x105223800

At this point I'm just looking for an easy workaround. Problem doesn't happen if I don't define "onClick", but that's not very useful. I will try to post a better error later.