浏览代码

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

neyrogovnarik 1 月之前
父节点
当前提交
1c794f2b28
共有 1 个文件被更改,包括 3 次插入1 次删除
  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 {