UNPKG

@activecollab/components

Version:

ActiveCollab Components

27 lines 761 B
import React, { forwardRef } from "react"; import classNames from "classnames"; import { useInitScrollRef } from "../../hooks"; import useForkRef from "../../utils/useForkRef"; export const ScrollElement = /*#__PURE__*/forwardRef((_ref, ref) => { let { as = "div", className, invert = false, style, ...rest } = _ref; const internalRef = useInitScrollRef(null, invert); const handleRef = useForkRef(internalRef, ref); const props = { ...rest, ref: handleRef, className: classNames("c-scroll-element", className), style: { overflow: "auto", ...style } }; return /*#__PURE__*/React.createElement(as, props); }); ScrollElement.displayName = "ScrollElement"; //# sourceMappingURL=ScrollElement.js.map