RN: Deprecate InteractionManager (#53832)

Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53832

Deprecates `InteractionManager` by adding a warning when it is imported.

Changelog:
[General][Changed] - InteractionManager has been deprecated and no longer respects interaction handles. Instead, it is now recommended to avoid executing long-running JavaScript tasks by breaking them up into smaller tasks and scheduling them using `requestIdleCallback()`.

Reviewed By: javache

Differential Revision: D82704809

fbshipit-source-id: 99474cd7949abfe323c366b9ab8d8fc195578395
This commit is contained in:
Tim Yung
2025-09-29 14:58:02 +01:00
committed by Vitali Zaidman
parent 458cd06bdb
commit fddf263dbc
+6
View File
@@ -224,6 +224,12 @@ module.exports = {
* @deprecated
*/
get InteractionManager() {
warnOnce(
'interaction-manager-deprecated',
'InteractionManager has been deprecated and will be removed in a ' +
'future release. Please refactor long tasks into smaller ones, and ' +
" use 'requestIdleCallback' instead.",
);
return require('./Libraries/Interaction/InteractionManager').default;
},
get Keyboard() {