문제

I found 2 sources where it kind of says that React is using requestAnimationFrame On this blog post about Om, a ClojureScript framework on top of React. Also on the comments of this SO answer.

I'm not sure it's part of React or if people are using it with React.

Can someone tell me what how requestAnimationFrame is used in React if it is? Or how it can be used with React and why I would choose to use it with React?

도움이 되었습니까?

해결책

React doesn't currently use requestAnimationFrame to do DOM updates (as we call it, the "batching strategy"). The batching strategy is injectible though so it's possible to use something else. Om makes use of that possibility and uses requestAnimationFrame to batch DOM updates.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top