"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.useFirstPaint = void 0;

var _useIsomorphicLayoutEffect = require("./useIsomorphicLayoutEffect");

var useFirstPaint = function useFirstPaint(cb) {
  (0, _useIsomorphicLayoutEffect.useIsomorphicLayoutEffect)(function () {
    var raf = window.requestAnimationFrame(function () {
      cb();
    });
    return function () {
      window.cancelAnimationFrame(raf);
    };
  }, [cb]);
};

exports.useFirstPaint = useFirstPaint;