11// eslint-disable-next-line max-classes-per-file
22import { cnb } from 'cnbuilder' ;
33import * as React from 'react' ;
4+ import { Context , PropsWithChildren } from 'react' ;
45import * as ReactDOM from 'react-dom' ;
56import * as simulant from 'simulant' ;
67import { Scrollbar , ScrollbarContext , ScrollbarProps , ScrollbarState } from '../src' ;
@@ -9,7 +10,7 @@ import { ScrollState, TRACK_CLICK_BEHAVIOR } from '../src/types';
910import { getScrollbarWidth , shouldReverseRtlScroll } from '../src/util' ;
1011
1112class ScrollbarPropsUpdater extends React . Component <
12- { scrollbarProps : ScrollbarProps } ,
13+ React . PropsWithChildren & { scrollbarProps : ScrollbarProps } ,
1314 { scrollbarProps : ScrollbarProps }
1415> {
1516 scrollbar : Scrollbar ;
@@ -338,7 +339,7 @@ describe('Scrollbar', () => {
338339 ) ;
339340 } ;
340341
341- class ErrorBoundary extends React . Component < unknown , { [ key : string ] : any } > {
342+ class ErrorBoundary extends React . Component < PropsWithChildren , { [ key : string ] : any } > {
342343 constructor ( props ) {
343344 super ( props ) ;
344345 this . state = { error : null , errorInfo : null } ;
@@ -1129,12 +1130,12 @@ describe('Scrollbar', () => {
11291130 it ( 'should create context if createContext is passed' , ( done ) => {
11301131 let consumedContext : ScrollbarContextValue ;
11311132
1132- class ScrollbarContextConsumer extends React . Component < unknown , unknown > {
1133+ class ScrollbarContextConsumer extends React . Component < PropsWithChildren , unknown > {
11331134 // eslint-disable-next-line react/static-property-placement
11341135 static contextType = ScrollbarContext ;
11351136
11361137 public componentDidMount ( ) : void {
1137- consumedContext = this . context ;
1138+ consumedContext = this . context as ScrollbarContextValue ;
11381139 }
11391140
11401141 render ( ) {
0 commit comments