raf-hook
A React hook for requestAnimationFrame()
.
Installation
$ yarn add raf-hook
or
$ npm install --save raf-hook
Import
;
Example usage
import React from 'react';import useRAF from 'raf-hook'; { const reqId = ; return <div> The request id is <strong>reqId</strong> It may be used with <code>windowcancelAnimationFrame</code> to cancel the request This be needed The hook properly manages the requests based on the life cycle </div> ;}