SHARE
TWEET

Untitled

a guest Feb 15th, 2019 70 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. );
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top