pagraphcontrol/utils/recompose/index.js
2019-08-11 00:39:28 +03:00

20 lines
365 B
JavaScript

const React = require('react');
const r = require('r-dom');
const forwardRef = () => Component => React.forwardRef((props, ref) => r(Component, {
...props,
__forwardedRef: ref,
}));
const unforwardRef = () => Component => ({ __forwardedRef, ...props }) => r(Component, {
...props,
ref: __forwardedRef,
});
module.exports = {
forwardRef,
unforwardRef,
};