/
IvanWake
/
cookieStore
Обзор
Документация
Войти
/
IvanWake
/
cookieStore
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
dev
src/components/Profile/ProfileContent.js
31 строка
938 B
Ivan Wake
Fix infinity re-renders
01 фев 2024, 15:10
01 фев 2024, 15:10
81051ca
Код
Авторство
О чём код?
import { useAuth } from '../../store/auth-store'; import { AnimatePresence } from 'framer-motion'; import AuthButtons from '../Auth/AuthButtons'; import Preloader from '../Layout/Preloader'; import Profile from './Profile'; const ProfileContent = () => { const isUserAuth = useAuth(state => state.isUserAuth); const isUserLoading = useAuth(state => state.isUserLoading); return ( <> { isUserLoading ? isUserAuth ? <AnimatePresence> <Profile /> </AnimatePresence> : <AnimatePresence> <AuthButtons/> </AnimatePresence> : <AnimatePresence> <Preloader width={'32px'} /> </AnimatePresence> } </> ); } export default ProfileContent;