UNPKG

refun

Version:

A collection of React Hook-enabled functions that compose harmoniously with each other. Similar to `recompose`, but:

15 lines (12 loc) 291 B
Object.defineProperty(exports, "__esModule", { value: true }); exports.mapRef = void 0; var _react = require("react"); const mapRef = (name, initialValue) => props => { const ref = (0, _react.useRef)(initialValue); return { ...props, [name]: ref }; }; exports.mapRef = mapRef;