title: How to assign value dynamically to TextInput using react native
body: <p>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.</p>
  
  <p>I am sending the route object through out the navigator,But in my scenario selected value should be reassign to the previous scene of TextInput .Here TextInput event structure is like the below</p>
  
  <pre><code>nativeEvent:
  { target: 2175,
  pageY: 164.5,
  locationX: 131,
  changedTouches: [ [Circular] ],
  locationY: 16.5,
  identifier: 1,
  pageX: 146,
  touches: [],
  timestamp: 6887223.188515 },
  target: undefined,
  currentTarget: null,
  path: undefined,
  type: undefined,
  eventPhase: undefined,
  bubbles: undefined,
  cancelable: undefined,
  timeStamp: 1445839347722,
  defaultPrevented: undefined,
  isTrusted: undefined,
  isDefaultPrevented: [Function],
  isPropagationStopped: [Function],
  _dispatchListeners: null,
  _dispatchIDs: null }
  </code></pre>
  
  <p>Both of this not working .What is the correct way to assign the value to the textinput.
  The current object getting is ok, my problem is assigning the selected value to the TextInput.</p>
  
  <p>Here i am following two approaches</p>
  
  <p>approach1:-</p>
  
  <pre><code>var FirstComponent = React.createClass({
       render:function(){
               return(&lt;TextInput value="" placeholder="Enter value" onFocus={getData.bind(this)} /&gt;)
        }
  })
  
  function getData(ev){
  var target = ev;
        this.props.navigator.push({
            id:'SecondComponent',
            name:'SecondComponent',
            target:target, 
         })
  }
  var SecondComponent = React.createClass({
          render:function(){
                 return(&lt;TouchableHighlight onPress={fillData.bind(this,target, self.props.navigator,selectedText)}&gt;&lt;Text&gt;sample&lt;/Text&gt;&lt;/TouchableHighlight&gt;)
          }
  });
  function fillData(target,nav,selectedText,ev){
  target.value=selectedText
  target.nativeEvent.target = selectedText
  target.nativeEvent.target .text= selectedText// Here ' target ' is route object this
  //Here target is root component this
  //how to fill selectedText in FirstComponent TextInput value
  }
  </code></pre>
  
  <p>Approach2:-</p>
  
  <pre><code>   var FirstComponent = React.createClass({
            getInitialState:function(){
              return {textValue:""};
          },
           render:function(){
                   return(&lt;TextInput value={this.state.textValue} placeholder="Enter value" onFocus={getData.bind(this)} /&gt;)
            }
      })
  
      function getData(ev){
      var target = ev;
            this.props.navigator.push({
                id:'SecondComponent',
                name:'SecondComponent',
                target:target, 
             })
      }
      var SecondComponent = React.createClass({
              render:function(){
                     return(&lt;TouchableHighlight onPress={fillData.bind(this,target, self.props.navigator,selectedText)}&gt;&lt;Text&gt;sample&lt;/Text&gt;&lt;/TouchableHighlight&gt;)
              }
      });
      function fillData(target,nav,selectedText,ev){
           target.setState({textValue:selectedText})//i am getting undefined is not a function
  
      //Here target is root component this   
      //how to fill selectedText in FirstComponent TextInput value
      }
  </code></pre>