Open olga-alexandrovnaa opened 1 year ago
Сбой был вызван неправильной реализацией асинхронного хука React.
useEffect(async () => { useEffect(() => { getSitemapSettings(); }, []);
@olga-alexandrovnaa Привет! А как ты решила проблему, не поделишься хаком?
Разобрался.
Конкретно у меня было так:
onLoad={onMapLoad}
const onMapLoad = useCallback((ref): void => (ymap.current = ref), []);
заменил на:
const onMapLoad = useCallback((ref): void => {
ymap.current = ref;
}, []);
Warning: useEffect must not return anything besides a function, which is used for clean-up. You returned: [object Object] at http://localhost:5173/node_modules/.vite/deps/@pbe_react-yandex-maps.js?v=b2e994ed:45:20
Uncaught TypeError: destroy is not a function at safelyCallDestroy (react-dom.development.js:22932:5) at commitHookEffectListUnmount (react-dom.development.js:23100:11) at commitPassiveUnmountInsideDeletedTreeOnFiber (react-dom.development.js:25098:11) at commitPassiveUnmountEffectsInsideOfDeletedTree_begin (react-dom.development.js:25048:5) at commitPassiveUnmountEffects_begin (react-dom.development.js:24956:11) at commitPassiveUnmountEffects (react-dom.development.js:24941:3) at flushPassiveEffectsImpl (react-dom.development.js:27038:3) at flushPassiveEffects (react-dom.development.js:26984:14) at react-dom.development.js:26769:9 at workLoop (scheduler.development.js:266:34)