Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import { withHandlers } from 'recompose';
- export const withRef = (onRef, getRefElement) => withHandlers(
- () => {
- let element = null;
- return {
- [onRef]: () => ref => {
- element = ref;
- },
- [getRefElement]: () => () => element,
- };
- }
- );
Add Comment
Please, Sign In to add comment