Skip to content

Instantly share code, notes, and snippets.

@WAV33333
WAV33333 / controller
Created June 8, 2026 07:46
score-samping
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8"/>
<meta name="viewport" content="width=device-width,initial-scale=1.0"/>
<title>Billiards Scorebug</title>
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=Barlow+Condensed:wght@700;800&display=swap" rel="stylesheet">
<style>
:root {
--bg: #140e21; --card: #1e1530; --card2: #251d38;
@SwarajDashDev
SwarajDashDev / defer-heavy-work-interactionmanager.md
Created June 8, 2026 07:45
Learn how to use React Native's InteractionManager to schedule expensive tasks after animations, keeping UI fluid and responsive.

Insight

In React Native, UI thread contention is a common cause of janky animations, especially when you start expensive calculations or network calls immediately after a navigation event. InteractionManager lets you schedule work to run only after all ongoing interactions—animations, gestures, transitions—have completed, freeing the UI thread for a smooth frame rate.

Example

import { InteractionManager } from 'react-native';
import { useEffect } from 'react';

export function Screen() {
 useEffect(() =&gt; {