@geezee/react-ui
Version:
Modern and minimalist React UI library.
27 lines (23 loc) • 845 B
JavaScript
import { useRef } from 'react';
export default (function () {
var ref = useRef(null);
return {
focus: function focus() {
var _ref$current;
return (_ref$current = ref.current) === null || _ref$current === void 0 ? void 0 : _ref$current.focus();
},
blur: function blur() {
var _ref$current2;
return (_ref$current2 = ref.current) === null || _ref$current2 === void 0 ? void 0 : _ref$current2.blur();
},
setValue: function setValue(val) {
var _ref$current3;
return (_ref$current3 = ref.current) === null || _ref$current3 === void 0 ? void 0 : _ref$current3.setValue(val);
},
getValue: function getValue() {
var _ref$current4;
return (_ref$current4 = ref.current) === null || _ref$current4 === void 0 ? void 0 : _ref$current4.getValue();
},
ref: ref
};
});