настройка проекта

main
Пилипенко Андрей Борисович 1 month ago
parent 4a2e74c8a2
commit 6ac828e2cf

@ -1 +1 @@
npx lint-staged
cd frontend && npx lint-staged

@ -9,7 +9,7 @@
"build": "tsc -b && vite build",
"lint": "eslint .",
"preview": "vite preview",
"prepare": "husky",
"prepare": "cd .. && husky frontend/.husky",
"preter": "npx eslint-config-prettier"
},
"dependencies": {
@ -50,11 +50,11 @@
},
"lint-staged": {
"*.{js,mjs,cjs,jsx,ts,tsx}": [
"prettier --write",
"eslint --fix"
"npx prettier --write",
"npx eslint --fix"
],
"*.{css,json,md,html,js.flow}": [
"prettier --write"
"npx prettier --write"
]
}
}

@ -38,13 +38,13 @@ export const LoadMore: FC<LoadMoreProps> = ({ action, isLoading, isEndOfList })
observer = new IntersectionObserver(callback, options)
// Если ссылка есть, то начинаем наблюдать за нашим элементом
ref.current && observer.observe(ref.current)
if (ref.current) observer.observe(ref.current)
}
return () => {
// Перед последующем запуском useLayoutEffect перестаем следить
// за всеми элементами
observer && observer.disconnect()
if (observer) observer.disconnect()
}
}, [action, isEndOfList])

Loading…
Cancel
Save