File tree Expand file tree Collapse file tree 4 files changed +12
-5
lines changed
libs/DatalensChartkit/components/ChartKitBase Expand file tree Collapse file tree 4 files changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ const widgetPlugin: PluginWidget = {
3434 } ,
3535 renderer : function Wrapper (
3636 props : Props ,
37- forwardedRef : React . RefObject < ChartWidgetWithWrapRefProps > ,
37+ forwardedRef ? : React . RefCallback < ChartWidgetWithWrapRefProps > ,
3838 ) {
3939 const rootNodeRef = React . useRef < HTMLDivElement > ( null ) ;
4040 const { onWidgetLoadData} = useWidgetContext ( {
Original file line number Diff line number Diff line change @@ -35,7 +35,9 @@ export type WidgetPluginData = ConfigItem['data'];
3535export type WidgetPluginDataWithTabs = ConfigItemWithTabs [ 'data' ] & { tabs : Array < CurrentTab > } ;
3636
3737export type WidgetPluginProps = Omit < PluginWidgetProps , 'data' > & {
38- forwardedRef : React . RefObject < ChartKit | ChartKitRef > ;
38+ forwardedRef ?:
39+ | React . RefObject < ChartKit | ChartKitRef >
40+ | React . RefCallback < ChartKit | ChartKitRef > ;
3941 data : WidgetPluginDataWithTabs | WidgetPluginData ;
4042 getMarkdown ?: ( props : { text : string } ) => Promise < { result : string ; meta ?: object } > ;
4143 debouncedAdjustWidgetLayout : DebouncedFunc < ( props : AdjustWidgetLayoutProps ) => void > ;
Original file line number Diff line number Diff line change @@ -191,7 +191,11 @@ export type ChartWithProviderProps = ChartsProps & {
191191 dataProvider : ChartKitDataProvider ;
192192} ;
193193
194- type ChartRefProp = { forwardedRef : React . RefObject < ChartKit | ChartKitRef > } ;
194+ type ChartRefProp = {
195+ forwardedRef ?:
196+ | React . RefObject < ChartKit | ChartKitRef >
197+ | React . RefCallback < ChartKit | ChartKitRef > ;
198+ } ;
195199
196200export type ChartWrapperWithRefProps =
197201 | ChartWidgetProviderPropsWithRefProps
Original file line number Diff line number Diff line change @@ -87,9 +87,10 @@ export type ChartKitBaseWrapperProps = ChartsProps & {
8787} ;
8888
8989export type ChartKitBaseWrapperWithRefProps = ChartKitBaseWrapperProps & {
90- forwardedRef :
90+ forwardedRef ? :
9191 | React . RefObject < ChartKit | ChartKitRef >
92- | React . MutableRefObject < ChartKit | ChartKitRef | null > ;
92+ | React . MutableRefObject < ChartKit | ChartKitRef | null >
93+ | React . RefCallback < ChartKit | ChartKitRef > ;
9394} ;
9495
9596export interface ChartKitWrapperState {
You can’t perform that action at this time.
0 commit comments