title: Firebase Insert is happening instead of update, no error is shown
body: <p>I am trying to update the fields in firebase database using react native and instead new entry is being inserted on the click of the button. </p>
  
  <pre><code>import React,{Component} from 'react';
  import {  Platform, StyleSheet, StatusBar, View, Text, TextInput, Button, Alert } from 'react-native';
  import {editAp} from '../pages/func';
  import firebase from 'firebase';
  if (!firebase.apps.length) {
   firebase.initializeApp({});
  }
  class Edit1 extends Component {
  constructor(props){
  super(props);
  this.state = {
      email:this.props.navigation.state.params.email,
      password:this.props.navigation.state.params.password,
      keyis:this.props.navigation.state.params.keyis,
   };
  }
  submit1=()=&gt;{
      console.log(this.props.navigation.state.params.keyis)
      firebase.database().ref('/users1').child(this.props.navigation.state.params.keyis).update(({email:this.state.email,password:this.state.password}))
      Alert.alert('Action!', 'user updated');
  }
  render(){
    return (
          &lt;View style={styles.container}&gt;
              &lt;Text&gt;Edit Here&lt;/Text&gt;
              &lt;TextInput style={{marginTop:20, height:40, borderColor:'gray', borderWidth:1}} onChangeText={email=&gt;this.setState({email})} value={this.state.email}/&gt;
              &lt;TextInput style={{marginTop:20, height:40, borderColor:'gray', borderWidth:1}} onChangeText={password=&gt;this.setState({password})} value={this.state.password}/&gt;
              &lt;TextInput style={{marginTop:20, height:40, borderColor:'gray', borderWidth:1}} onChangeText={keyis=&gt;this.setState({keyis})} value={this.state.keyis}/&gt;
         &lt;Button title='Submit' onPress={this.submit1} /&gt;
          &lt;/View&gt;
      );
      }
  }
   const styles = StyleSheet.create({
   container: {
   flex:1,
   justifyContent: 'center',
   backgroundColor: '#fff',
   padding: 30,
   },
   });
   export default Edit1;
  </code></pre>
  
  <p>I am not knowing what's wrong with my update function email, password, keyis value i am getting on the textinput field as well as console, What is wrong in the submit1 function??
  Structure of database is given below:</p>
  
  <p><a href="https://i.stack.imgur.com/VqAez.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/VqAez.png" alt="Database Structure"></a></p>
  
  <p>insert code:</p>
  
  <pre><code>    import React,{Component} from 'react';
  import {  Platform, StyleSheet, StatusBar, View, Text, TextInput, Alert, Button, TouchableOpacity, FlatList } from 'react-native';
  import firebase from 'firebase';
  if (!firebase.apps.length) {    firebase.initializeApp({}); }
  class Form2 extends Component&lt;{}&gt; {
    constructor(props){
      super(props);
     this.state = {
       email:'',
      password:'',
        };  }
     addNew = () =&gt; {
      firebase.database().ref('/users1').push({
        email: this.state.email,
        password: this.state.password,
  
      });
      Alert.alert('Action!', 'user added');
      this.setState({
        email:'',
        password:'',
  });  }
     render() {
    return(
  &lt;View style={styles.container}&gt;
  &lt;Text style={styles.inpt}&gt;Insert Ravel&lt;/Text&gt;
  &lt;TextInput style={styles.inputBox1} underlinerColorAndroid='rgba(0,0,0,0)'
  placeholder="Email"  onChangeText={e =&gt; { this.setState({  email: e,            });          }}     /&gt;
  &lt;TextInput style={styles.inputBox2} underlinerColorAndroid='rgba(0,0,0,0)'  placeholder="password" 
  onChangeText={e =&gt; { this.setState({ password: e,            });       }}   /&gt;
  &lt;View style={styles.button1}&gt;
  &lt;Button title='Insert Record' onPress={this.addNew.bind(this)}/&gt;
  &lt;/View&gt;&lt;/View&gt;  )   } }
  export default Form2;
  </code></pre>