**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 enter image description here**n
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("value", function(snap){
Led1Status = snap.val().Led1Status;
jQuery(".toggleSwitch").on(function(){
let firebaseRef = firebase.database().ref().child("Led1Status");
if(Led1Status === "1"){ // post to firebase
firebaseRef.set("0");
Led1Status = "0";
} else {
firebaseRef.set("1");
Led1Status = "1";
}
})
});
}
);
return (
<div className="toggle-switch">
<input
type="checkbox"
className="toggle-switch-checkbox"
name="toggleSwitch"
id="toggleSwitch"
/>
<label className="toggle-switch-label" htmlFor="toggleSwitch">
<span className="toggle-switch-inner" />
<span className="toggle-switch-switch" />
</label>
</div>
);
}