InteractionManager.runAfterInteractions(task) promised to hold heavy work until running animations and touches had finished, so JavaScript-driven animations would not stutter. That scheduler is gone: React Native 36,878 deprecated InteractionManager, and 0.86 ships a stub whose runAfterInteractions() is setImmediate() and whose createInteractionHandle() returns -1:
Animated.timing(x, { toValue: 200, duration: 500, useNativeDriver: false })
.start(() => log('animation finished')); // a JS-driven "interaction"
InteractionManager.runAfterInteractions(() => log('runAfterInteractions task'));
requestIdleCallback((d) =>
log('requestIdleCallback, time left', Math.round(d.timeRemaining())));Output
WARN InteractionManager has been deprecated and will be removed in a future release. ... LOG +50ms runAfterInteractions task LOG +557ms animation finished LOG +763ms requestIdleCallback, time left 50
The task ran 50 ms in, long before the animation ended. The warning goes on: "Please refactor long tasks into smaller ones, and use 'requestIdleCallback' instead", which runs when JavaScript is idle, with a deadline to respect. Better still, use the native driver or Reanimated 11,010 , which JavaScript work cannot stall.