Skip to content

Commit 03d9f34

Browse files
yungstersfacebook-github-bot
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 4a13882 commit 03d9f34

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
@@ -230,6 +230,12 @@ module.exports = {
230230
* @deprecated
231231
*/
232232
get InteractionManager() {
233+
warnOnce(
234+
'interaction-manager-deprecated',
235+
'InteractionManager has been deprecated and will be removed in a ' +
236+
'future release. Please refactor long tasks into smaller ones, and ' +
237+
" use 'requestIdleCallback' instead.",
238+
);
233239
return require('./Libraries/Interaction/InteractionManager').default;
234240
},
235241
get Keyboard() {

0 commit comments

Comments
 (0)