简体   繁体   中英

how can i reload the page after deleting in react native

this is my code to reject a profile to delete them how can I reload the page automatically after deleting it?

const canceller = (item) => {
        firebase.firestore()
        .collection("ServiceProvider")
        .doc(item)
        .delete()
        .then(()=>{
           
          
           alert(`you have deleted the profile successfully  `);

You can call a state variable in your .then() method to cause your page to reload.

You can also use firebase's onSnapshot() methods, but this depends on how/if you're rending data from your ServiceProvider collection.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM