UNPKG

@awsui/components-react

Version:

AWS UI is a collection of [React](https://reactjs.org/) components that help create intuitive, responsive, and accessible user experiences for web applications. It is developed by Amazon Web Services (AWS). This work is available under the terms of the [A

14 lines (13 loc) 496 B
import { useImperativeHandle } from 'react'; export default function useForwardFocus(mainRef, controlRef) { useImperativeHandle(mainRef, function () { return ({ focus: function () { var _a; var args = []; for (var _i = 0; _i < arguments.length; _i++) { args[_i] = arguments[_i]; } (_a = controlRef.current) === null || _a === void 0 ? void 0 : _a.focus.apply(_a, args); } }); }, [controlRef]); }