Quantcast
Channel: Recent Questions - Stack Overflow
Viewing all articles
Browse latest Browse all 15521

How FaceBook refreshes WhatsApp app more often to re-render the state of the app even if the app is opened

$
0
0

`I used to wonder how Facebook refreshes WhatsApp very often even if the app is open on the users devices. I finally managed to find something that does simillar things. I worked on a personal project just lask week and I wanted to implement that refreshing state in the app. I searched but could not find any answer to help me. This morning I was reading something on [https://noriginmedia.com/focus-navigation-in-androidtv-with-react-native/] this platform that helped me create something to solve my last week unsolved issue.

Even when the screen goes off and you tap on it it shows some flahes showing that there has been a state update. so quickly I returned to a question that I spent some time on its answers last week but coudn't help me to solve it.So I quickly share my thought as well on that questions.

below is the linkLink to blog

Now coming back to my questionMy question is what is the right way to implement refreshing system like the current version of WhatsApp does. Please help me

I do not know whether what I am sharing is the correct thing to do. In case there is a better way to achieve the refreshing system on WhatsApp, please help me.

below is what I did

 const [ContLoading, setContLoading] = useState(false) const isFocused = useIsFocused()    useEffect(() => {        if (isFocused) {            //Update the state of all components on the page            setContLoading(true)        }    }, [isFocused])

It refreshes the state all components on the page even when you tap on screen if off`

I tried something myself but do not know if that is the right way of implementing what I want to achieve


Viewing all articles
Browse latest Browse all 15521

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>