In my scenario, while focus on TextInput i am moving to another scene using navigator (using push)there i populate list,in that list selecting one value that value should be populated to the previous scene of TextInput In this case I am unable to set the selected value to the previous scene of TextInput.
My code structure is
var FirstComponent = React.createClass({
render:function(){
return(<TextInput value="" placeholder="Enter value" onFocus={getData.bind(this)} />)
}
})
function getData(ev){
var target = ev;
this.props.navigator.push({
id:'SecondComponent',
name:'SecondComponent',
target:target,
})
}
var SecondComponent = React.createClass({
render:function(){
return(<TouchableHighlight onPress={fillData.bind(this,target, self.props.navigator,selectedText)}><Text>sample</Text></TouchableHighlight>)
}
});
function fillData(rootThis,nav,selectedText,ev){
rootThis.value=selectedText;
rootThis.nativeEvent.target = selectedText;
rootThis.nativeEvent.target .text= selectedText; // Here ' rootThis ' is route object 'this'
//how to fill selectedText in FirstComponent TextInput value
}