Explorar el Código

fix: dynamic import MapPicker для избежания SSR ошибки

neyrogovnarik hace 1 mes
padre
commit
1c794f2b28
Se han modificado 1 ficheros con 3 adiciones y 1 borrados
  1. 3 1
      frontend/src/components/PlaceForm.tsx

+ 3 - 1
frontend/src/components/PlaceForm.tsx

@@ -2,9 +2,11 @@
 
 import { useState, useEffect } from 'react'
 import { useRouter } from 'next/navigation'
+import dynamic from 'next/dynamic'
 import { api } from '@/lib/api'
 import type { Tag, Feature } from '@/types'
-import MapPicker from './MapPicker'
+
+const MapPicker = dynamic(() => import('./MapPicker'), { ssr: false })
 
 /** Пропсы компонента формы создания места/студии */
 interface PlaceFormProps {