Ver Fonte

explicit RefObjects for some reason

Adam Shaw há 5 anos atrás
pai
commit
0ecb13a56c

+ 3 - 2
packages/daygrid/src/TableView.tsx

@@ -7,7 +7,8 @@ import {
   ScrollGridSectionConfig,
   ViewRoot,
   DateComponent,
-  ViewProps
+  ViewProps,
+  RefObject
 } from '@fullcalendar/core'
 
 
@@ -19,7 +20,7 @@ import {
 
 export default abstract class TableView<State={}> extends DateComponent<ViewProps, State> {
 
-  protected headerElRef = createRef<HTMLTableCellElement>()
+  protected headerElRef: RefObject<HTMLTableCellElement> = createRef<HTMLTableCellElement>()
 
 
   renderSimpleLayout(

+ 6 - 4
packages/timegrid/src/TimeColsView.tsx

@@ -12,7 +12,8 @@ import {
   WeekNumberRoot,
   RenderHook,
   DateComponent,
-  ViewProps
+  ViewProps,
+  RefObject
 } from '@fullcalendar/core'
 import AllDaySplitter from './AllDaySplitter'
 import { TimeSlatMeta, TimeColsAxisCell } from './TimeColsSlats'
@@ -30,9 +31,10 @@ const AUTO_ALL_DAY_MAX_EVENT_ROWS = 5
 export default abstract class TimeColsView extends DateComponent<ViewProps> {
 
   protected allDaySplitter = new AllDaySplitter() // for use by subclasses
-  protected headerElRef = createRef<HTMLTableCellElement>()
-  private rootElRef = createRef<HTMLDivElement>()
-  private scrollerElRef = createRef<HTMLDivElement>()
+
+  protected headerElRef: RefObject<HTMLTableCellElement> = createRef<HTMLTableCellElement>()
+  private rootElRef: RefObject<HTMLDivElement> = createRef<HTMLDivElement>()
+  private scrollerElRef: RefObject<HTMLDivElement> = createRef<HTMLDivElement>()
 
 
   // rendering