Просмотр исходного кода

fix(ui): Set lazy calendar component type (#52381)

Scott Cooper 1 год назад
Родитель
Сommit
94f67fd04f
1 измененных файлов с 5 добавлено и 2 удалено
  1. 5 2
      static/app/components/calendar/index.tsx

+ 5 - 2
static/app/components/calendar/index.tsx

@@ -6,8 +6,11 @@ import Placeholder from 'sentry/components/placeholder';
 import type {DatePickerProps} from './datePicker';
 import type {DateRangePickerProps} from './dateRangePicker';
 
-const LazyDatePicker = lazy(() => import('./datePicker'));
-const LazyDateRangePicker = lazy(() => import('./dateRangePicker'));
+// Explicity set component type to avoid complex React.lazy type
+const LazyDatePicker: React.FC<DatePickerProps> = lazy(() => import('./datePicker'));
+const LazyDateRangePicker: React.FC<DateRangePickerProps> = lazy(
+  () => import('./dateRangePicker')
+);
 
 function CalendarSuspenseWrapper({children}: {children: React.ReactNode}) {
   return (