Skip to content

Instantly share code, notes, and snippets.

View SudoPlz's full-sized avatar
💥
shipit

Ioannis Kokkinidis SudoPlz

💥
shipit
View GitHub Profile

Reduced Motion + React-Freeze Bug Analysis

Problem Summary

Issue: Gray screen appears on Android when users enable "Reduce Motion" accessibility setting and quickly swipe between channels.

Root Cause: Animation updates (translateX) arrive while components are frozen/unregistered, causing updates to be lost and components to render with stale values.

Context: I've been working on this issue and there are currently three different solutions in play. I want to present the situation to the team and get alignment on the best approach.

React Freeze Performance Analysis Report

Executive Summary

This comprehensive performance analysis compares react-freeze against custom freeze implementations and a no-optimization baseline. The results demonstrate that react-freeze provides superior performance across all metrics, with 8x faster frozen rendering and 3.6x fewer total renders compared to no optimization.

Test Methodology

package com.imagepicker;
import android.app.Activity;
import android.content.ActivityNotFoundException;
import android.content.Intent;
import android.net.Uri;
import android.os.Build;
import android.provider.MediaStore;
import androidx.activity.result.ActivityResultLauncher;
@SudoPlz
SudoPlz / Readme.md
Last active July 22, 2025 09:52
React Native Reanimated Microtask Bug

Reanimated Animations Stalling?

How Szymon and I traced it to an Infinite Loop & Fixed It

tl;dr – A tiny helper (infiniteThenable) inside react-freeze made React’s Fabric scheduler loop forever, so the JS → UI microtask bridge never got a chance to flush. We patched the scheduler to flush manually and replaced the culprit with React 19’s Offscreen – animations are smooth again.


1. The Symptoms

  • Animations powered by Reanimated randomly froze.
/**
* @param string $parentAccountName - the account id you want to fetch locations for (i.e. accounts/105837778216009211413)
* @param array|string|null $readMask - the fields you want to include in the response, available fields here https://developers.google.com/my-business/reference/businessinformation/rest/v1/locations#resource:-location
* @return array
* @throws Exception
*/
public function getAllLocationsForAccount(string $parentAccountName, array|string|null $readMask = "name,title,storecode,labels"): array
{
$businessInformationService = new MyBusinessBusinessInformation($this->client);
try {
@SudoPlz
SudoPlz / react-native.patch
Created October 23, 2023 17:59
React-Native RCTLinking patch to never miss deep links
diff --git a/node_modules/react-native/Libraries/LinkingIOS/RCTLinkingManager.mm b/node_modules/react-native/Libraries/LinkingIOS/RCTLinkingManager.mm
index cfa9078..6a3daf5 100644
--- a/node_modules/react-native/Libraries/LinkingIOS/RCTLinkingManager.mm
+++ b/node_modules/react-native/Libraries/LinkingIOS/RCTLinkingManager.mm
@@ -18,15 +18,19 @@
static void postNotificationWithURL(NSURL *URL, id sender)
{
+
NSDictionary<NSString *, id> *payload = @{@"url" : URL.absoluteString};
diff --git a/node_modules/@react-native-community/datetimepicker/ios/RNDateTimePickerManager.m b/node_modules/@react-native-community/datetimepicker/ios/RNDateTimePickerManager.m
index d1cd1cd..817f6c9 100644
--- a/node_modules/@react-native-community/datetimepicker/ios/RNDateTimePickerManager.m
+++ b/node_modules/@react-native-community/datetimepicker/ios/RNDateTimePickerManager.m
@@ -31,13 +31,16 @@ @implementation RCTConvert(UIDatePicker)
@end
-@implementation RNDateTimePickerManager
+@implementation RNDateTimePickerManager {
diff --git a/node_modules/react-native-navigation/ReactNativeNavigation.podspec b/node_modules/react-native-navigation/ReactNativeNavigation.podspec
index e960e50..2ad453a 100644
--- a/node_modules/react-native-navigation/ReactNativeNavigation.podspec
+++ b/node_modules/react-native-navigation/ReactNativeNavigation.podspec
@@ -33,7 +33,5 @@ Pod::Spec.new do |s|
end
s.dependency 'React'
- s.dependency 'React-RCTImage'
- s.dependency 'React-RCTText'
package com.acuityscheduling.app.android.Calendar.React;
import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.bridge.ReadableArray;
import com.facebook.react.bridge.ReadableMap;
import com.facebook.react.uimanager.ShadowNodeRegistry;
import com.facebook.react.uimanager.ThemedReactContext;
import com.facebook.react.uimanager.UIImplementation;
import com.facebook.react.uimanager.UIManagerModule;
import com.facebook.react.uimanager.ViewManager;
import _ from 'underscore';
export default class HoldList {
constructor() {
this.holdList = [];
this.runningRequestCnt = 0;
}
invokeAll(err, exclude) {