mirror of
https://github.com/furyhawk/home_stack.git
synced 2026-07-21 02:06:47 +00:00
Fix WeatherMap lazy loading conflict: Import directly instead of lazy-loading
This commit is contained in:
@@ -8,7 +8,9 @@ const AirTemperature = React.lazy(() => import('@/components/weather/AirTemperat
|
||||
const FourDayOutlook = React.lazy(() => import('@/components/weather/FourDayOutlook'));
|
||||
const WeatherStatistics = React.lazy(() => import('@/components/weather/WeatherStatistics'));
|
||||
const WindDirection = React.lazy(() => import('@/components/weather/WindDirection'));
|
||||
const WeatherMap = React.lazy(() => import('@/components/weather/WeatherMap'));
|
||||
// Note: WeatherMap is NOT lazy-loaded here because it's directly imported by TwoHourForecast
|
||||
// Lazy-loading it here would cause React to treat it as a different component instance
|
||||
import WeatherMap from '@/components/weather/WeatherMap';
|
||||
|
||||
const tabValues = {
|
||||
twoHour: 'twoHourForecast',
|
||||
@@ -71,9 +73,7 @@ function WeatherHub() {
|
||||
</React.Suspense>
|
||||
</ChakraTabs.Content>
|
||||
<ChakraTabs.Content value={tabValues.weatherMap}>
|
||||
<React.Suspense fallback={<Box>Loading map...</Box>}>
|
||||
<WeatherMap />
|
||||
</React.Suspense>
|
||||
<WeatherMap />
|
||||
</ChakraTabs.Content>
|
||||
</ChakraTabs.ContentGroup>
|
||||
</ChakraTabs.Root>
|
||||
|
||||
Reference in New Issue
Block a user