Problem Statement
What happens when the JavaScript thread is blocked, and how can it be avoided?
Explanation
If the JS thread is blocked by heavy computation or infinite loops, the app becomes unresponsive because UI updates depend on it.
To prevent this, offload heavy tasks to native modules or use libraries like react-native-reanimated or worker threads for background execution.
Practice Sets
This question appears in the following practice sets: