Guest User

Untitled

a guest
Feb 15th, 2019
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.27 KB | None | 0 0
  1. import { withHandlers } from 'recompose';
  2.  
  3. export const withRef = (onRef, getRefElement) => withHandlers(
  4. () => {
  5. let element = null;
  6. return {
  7. [onRef]: () => ref => {
  8. element = ref;
  9. },
  10. [getRefElement]: () => () => element,
  11. };
  12. }
  13. );
Add Comment
Please, Sign In to add comment