web icon indicating copy to clipboard operation
web copied to clipboard

use-raf hook: animation hook for react using requestAnimationFrame

Open Sparkenstein opened this issue 3 years ago • 5 comments

What new hook does?

Checklist

  • [x] Have you read contribution guideline?
  • [x] Does the code have comments in hard-to-understand areas?
  • [ ] Is there an existing issue for this PR?
  • [x] Have the files been linted and formatted?
  • [x] Have the docs been updated?
  • [x] Have the tests been added to cover new hook?
    • NOTE: need more tests
  • [x] Have you run the tests locally to confirm they pass?

Sparkenstein avatar Jan 31 '22 08:01 Sparkenstein

Few questions:

  • I am not really good with Jest, need to add more tests. please suggest new tests and approaches.
  • I was referring react-use test cases for useRaf, it uses raf-stub which is written in JS. so couldn't use it in tests as types are not available for it

Sparkenstein avatar Jan 31 '22 08:01 Sparkenstein

any plan to merge this?

Sparkenstein avatar Feb 02 '22 09:02 Sparkenstein

i have several notices on implementation, but I'm ill ATM, will do the review later.

xobotyi avatar Feb 02 '22 09:02 xobotyi

I was referring react-use test cases for useRaf, it uses raf-stub which is written in JS. so couldn't use it in tests as types are not available for it

Tests don't require raf-stub since Jest provides pretty much all needed functionality, see https://github.com/react-hookz/web/blob/master/src/useRafCallback/tests/dom.ts

xobotyi avatar Feb 10 '22 06:02 xobotyi

Please consider https://github.com/streamich/react-use/pull/2215

SCG82 avatar Sep 08 '22 10:09 SCG82