Skip to content

Commit

Permalink
Bind rAF and cAF to window (facebook#16606)
Browse files Browse the repository at this point in the history
When capturing local references of requestAnimationFrame and cancelAnimationFrame - bind them to the window object.
Fixes facebook#16606
  • Loading branch information
liady authored Sep 9, 2019
1 parent 9444c87 commit fdde08f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/scheduler/src/forks/SchedulerHostConfig.default.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ if (
const Date = window.Date;
const setTimeout = window.setTimeout;
const clearTimeout = window.clearTimeout;
const requestAnimationFrame = window.requestAnimationFrame;
const cancelAnimationFrame = window.cancelAnimationFrame;
const requestAnimationFrame = window.requestAnimationFrame && window.requestAnimationFrame.bind(window);
const cancelAnimationFrame = window.cancelAnimationFrame && window.cancelAnimationFrame.bind(window);

if (typeof console !== 'undefined') {
// TODO: Remove fb.me link
Expand Down

0 comments on commit fdde08f

Please sign in to comment.