haxe-react / react-native

React Native externs for Haxe
61 stars 9 forks source link

jsx applied to custom component causes invariant violation. #18

Closed serjek closed 5 years ago

serjek commented 6 years ago

Expected ref to be a function or a string error appears when trying jsx(<CustomScene/>); Registering CustomScene as app will work fine; jsx of some default component (say, View) also works fine. Problem is with custom components that extend ReactComponent in haxe.

serjek commented 6 years ago

Turns out that adding ref="" to component like this jsx(<CustomScene ref=""/>); solves the issue, although this is not obvious, so I'm keeping issue open.

kevinresol commented 5 years ago

The jsx macro has changed a lot and let me assume this is obsolete.