Shared:Components:Scrollbar: remove throw error

This commit is contained in:
Timofey Boyko 2024-02-05 15:56:38 +03:00
parent b6b8777437
commit 27bf9c7202
3 changed files with 8 additions and 11 deletions

View File

@ -72,16 +72,13 @@ const Scrollbar = React.forwardRef((props: ScrollbarProps, ref) => {
const renderScroller = React.useCallback(
(libProps: { elementRef: React.RefObject<HTMLDivElement> }) => {
const { elementRef, ...restLibProps } = libProps;
console.log(elementRef);
return (
<div
{...restLibProps}
key="scroll-renderer-div"
className={classNames("scroller", scrollclass || "") || "scroller"}
ref={(ref) => {
console.log(ref);
return elementRef(ref);
}}
ref={elementRef}
onScroll={onScroll}
/>
);

View File

@ -47,9 +47,9 @@ class ScrollbarThumb extends React.Component<ScrollbarThumbProps, unknown> {
public componentDidMount(): void {
if (!this.element) {
this.setState(() => {
throw new Error(
"<ScrollbarThumb> Element was not created. Possibly you haven't provided HTMLDivElement to renderer's `elementRef` function.",
);
// throw new Error(
// "<ScrollbarThumb> Element was not created. Possibly you haven't provided HTMLDivElement to renderer's `elementRef` function.",
// );
});
}
}

View File

@ -22,9 +22,9 @@ class ScrollbarTrack extends React.Component<ScrollbarTrackProps, unknown> {
public componentDidMount(): void {
if (!this.element) {
this.setState(() => {
throw new Error(
"Element was not created. Possibly you haven't provided HTMLDivElement to renderer's `elementRef` function.",
);
// throw new Error(
// "Element was not created. Possibly you haven't provided HTMLDivElement to renderer's `elementRef` function.",
// );
});
return;
}