I'm trying to extend the react-native TextInput
(RCTTextField
/RCTTextFieldManager
) that I'm able to pass a react component (e.g. <Picker >...</Picker>
) as an attribute (e.g. input
) that will be set as the UITextInput
s inputView
attribute.
I'd expect to be able to pass a react component as a property to a native component as follows:
RCTTextFieldManager.m:
RCT_EXPORT_VIEW_PROPERTY(input, UIView)
Form.js
render() {
return (
<TextInput input={<Picker>...</Picker>} />
)
}
This results in the following error:
2016-06-04 22:17:50.537 [fatal][tid:com.facebook.react.ShadowQueue] Exception '*** -[__NSArrayM insertObject:atIndex:]: index 3 beyond bounds [0 .. 1]' was thrown while invoking manageChildren on target RCTUIManager with params (
9,
"<null>",
"<null>",
(
98
),
(
3
),
"<null>"
)
(How) is it possible to pass a react component as a property to a native component?