@chayns-components/core
Version:
A set of beautiful React components for developing your own applications with chayns.
30 lines • 867 B
JavaScript
import { getDevice } from 'chayns-api';
import React, { forwardRef, useMemo } from 'react';
import { StyledScrollView } from './ScrollView.styles';
const ScrollView = /*#__PURE__*/forwardRef((_ref, ref) => {
let {
maxHeight = 300,
height,
maxWidth,
width,
children,
overflowX = 'auto',
overflowY = 'auto'
} = _ref;
const {
browser
} = getDevice();
return useMemo(() => /*#__PURE__*/React.createElement(StyledScrollView, {
$browser: browser?.name,
$maxHeight: maxHeight,
$height: height,
$maxWidth: maxWidth,
$width: width,
$overflowX: overflowX,
$overflowY: overflowY,
ref: ref
}, children), [browser?.name, children, height, maxHeight, maxWidth, overflowX, overflowY, ref, width]);
});
ScrollView.displayName = 'ScrollView';
export default ScrollView;
//# sourceMappingURL=ScrollView.js.map