Skip to content

Commit fddf263

Browse files
yungstersvzaidman
authored andcommitted
RN: Deprecate InteractionManager (#53832)
Summary: Pull Request resolved: #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
1 parent 458cd06 commit fddf263

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

packages/react-native/index.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,12 @@ module.exports = {
224224
* @deprecated
225225
*/
226226
get InteractionManager() {
227+
warnOnce(
228+
'interaction-manager-deprecated',
229+
'InteractionManager has been deprecated and will be removed in a ' +
230+
'future release. Please refactor long tasks into smaller ones, and ' +
231+
" use 'requestIdleCallback' instead.",
232+
);
227233
return require('./Libraries/Interaction/InteractionManager').default;
228234
},
229235
get Keyboard() {

0 commit comments

Comments
 (0)