wuct/react-dom-utils

View on GitHub
example/WithOffsetToRoot.js

Summary

Maintainability
A
35 mins
Test Coverage
import React from 'react'
import throttle from 'raf-throttle'
import withOffsetToRoot from '../src/withOffsetToRoot'

const style = {
  width: 200,
  height: 200,
  backgroundColor: '#93626A',
}

const component = ({ offsetToRoot }) => (
  <div style={style}>
    {JSON.stringify(offsetToRoot)}
  </div>
)

export default withOffsetToRoot(throttle)(component)