Shared:Components:Scrollbar: remove throw error
This commit is contained in:
parent
b6b8777437
commit
27bf9c7202
@ -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}
|
||||
/>
|
||||
);
|
||||
|
@ -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.",
|
||||
// );
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user