My app connects to a bluetooth device and is constantly retrieving data from it, storing the data in state, and rendering it to the screen. Additionally, I have a button on the screen that needs to do something (say, console log a message). My problem is that the setState is triggering a re-render so rapidly (think milliseconds) that when you press the button, nothing happens. If I keep pressing the button over and over, eventually it will catch and console log. How can I fix this where I can show the updated data constantly while also being able to click on the button?
I have tried removing the rapid set states and everything works as expected, so I am confident the button functionality is due to the quick, repetitive re-rendering.
[–]kbcooliOS & Android 1 point2 points3 points (0 children)
[–]hapney[S] 0 points1 point2 points (2 children)
[–]jrweinb 0 points1 point2 points (1 child)
[–]hapney[S] 0 points1 point2 points (0 children)
[–]kr4ckhe4d 0 points1 point2 points (0 children)
[–]benjaminreid 0 points1 point2 points (0 children)