Defer expensive react rendering with rAF
$ npm install defer-render-hoc --save
import React, { Component } from 'react'
import DeferRender from 'defer-render-hoc'
class RandomComp extends Component {
...
render () {
const { scroll } = this.props
...
}
}
export default DeferRender(RandomComp)
See this CodeSandbox for a demo.
MIT © Jack Hanford