title: can't connect ToggleSwitch button to firebase
body: <p>**i'm  trying to  make connection between firebase and toggle switch button in reactjs app  to do specific action but  nothing appear like  child  or new element in firebase <a href="https://i.stack.imgur.com/bPkSI.png" rel="nofollow noreferrer">enter image description here</a>**n</p>
  <pre><code>import jQuery from 'jquery';
  import  firebase from 'firebase';
  
  
  
    export default function ToggleSwitch_temp() {
      
    
    jQuery(document).on(function(){
        var database = firebase.database();
      var Led1Status;
    
      database.ref().on(&quot;value&quot;, function(snap){
        Led1Status = snap.val().Led1Status;
        
        jQuery(&quot;.toggleSwitch&quot;).on(function(){
          let firebaseRef = firebase.database().ref().child(&quot;Led1Status&quot;);
      
          if(Led1Status === &quot;1&quot;){    // post to firebase
            firebaseRef.set(&quot;0&quot;);
            Led1Status = &quot;0&quot;;
          } else {
            firebaseRef.set(&quot;1&quot;);
            Led1Status = &quot;1&quot;;
          }
        })
      });
     
        
        }
      );
    
  
      return (
        &lt;div className=&quot;toggle-switch&quot;&gt;
          &lt;input
            type=&quot;checkbox&quot;
            className=&quot;toggle-switch-checkbox&quot;
            name=&quot;toggleSwitch&quot;
            id=&quot;toggleSwitch&quot;
          /&gt;
          &lt;label className=&quot;toggle-switch-label&quot; htmlFor=&quot;toggleSwitch&quot;&gt;
            &lt;span className=&quot;toggle-switch-inner&quot; /&gt;
            &lt;span className=&quot;toggle-switch-switch&quot; /&gt;
          &lt;/label&gt;
        &lt;/div&gt;
      );
    
  }
  </code></pre>