song
@johyesong86860969
Reviews Written
1
Average Rating
5.0
Posts
Q&A
swr๊ด๋ จ ์ง๋ฌธ
๊ทธ๋ฐ๋ฐ ์ ๊ฐ ๊ฐ์๊ธฐ ๋ ์๋ฌธ์ธ๋ฐ..swr๋ก๋ ์ํ ๊ด๋ฆฌ๊ฐ ๊ทธ๋ฌ๋ฉด ๋ถ๊ฐ๋ฅ ํ์ฃ ? ๊ทธ๋ฌ๋ฉด swr๋ก ๋ฐ์์จ ๊ฐ๋ค์ ๋ฆฌ๋์ค์ useselector์ฒ๋ผ ์ฌ๋ฌ ์ปดํฌ๋ํธ์์ ์ฌ์ฉํ ์ ์๊ฒ ๋ค์ ..?props๋ก ๋๊ฒจ์ฃผ๋ ๋ฐฉ๋ฒ ๋ง๊ณ ๋.. ?
- 0
- 4
- 313
Q&A
swr๊ด๋ จ ์ง๋ฌธ
์ญ์ ์ ๋ก์ด๋์ ์ ๋ง ์งฑ์ด์๋ค์..!
- 0
- 4
- 313
Q&A
์ ๋ก์ด๋ ๊ถ๊ธํ ์ ์ด ์์ต๋๋ค![passport ์์ ๋ก๊ทธ์ธ ๊ด๋ จ]
๋ ๊ฐ์ฌํฉ๋๋ค!
- 0
- 2
- 282
Q&A
์๋ ํ์ธ์ ์ ๋ก์ด๋
๊ฐ์ฌํฉ๋๋ค!!!!!
- 0
- 4
- 386
Q&A
์๋ ํ์ธ์ ์ ๋ก์ด๋
์ ์ค ์๋ฒ๋ ์ ๋ฐ ์ค์ ์ด ํ์ํ๊ณ localhost์์๋ sameSite ์ฟ ํค ์ค์ ์ด ํ์์๋๊ฑด๊ฐ์ ?! (ํญ์ ๋น ๋ฅธ ๋ต๋ณ ๊ฐ์ํฉ๋๋ค....) local์์๋ credentials: true,๋ง ์ค์ ํ๋ฉด ๋๋์ ?
- 0
- 4
- 386
Q&A
์๋ ํ์ธ์
๊ฐ์ํฉ๋๋ค~~
- 0
- 2
- 352
Q&A
์๋ ํ์ธ์
์ด๋ฐ...๋ฉ์ฒญ ใ ใ ใ ใ ใ ใ ใ ใ ใ ใ ใ ใ ใ ํ ์ค์๋ค์..ํ..์ฐธ ใ ใ ์ฐฝํผํด ์ฃฝ๊ฒ ๋ค์.. ์ ๋๋ก ์ถ๋ ฅ ํ๋ฉด ใ ใ console.log(window.scrollY,document.documentElement.clientHeight ,document.documentElement.scrollHeight ) ๋ณธ๋ก ์ผ๋ก ๋์์์...document.documentElement.scrollHeigh ๊ฐ ์ฆ๊ฐํ๋ฉด ์๋๋ค๊ณ ํ์ จ๋๋ฐ.. ์ฌ๊ธฐ์์ ์ฆ๊ฐํ๋ ๋ชจ์ต์ ๋ณด์ ๋๋ค.. ๊ทธ๋์ใ ใ ์ ๋ ์ด๊ฒ ๋ง๋ ๊ฑฐ๋ผ๊ณ ์๊ฐํ๋๋ฐ.. ใ ใ ใ (์ฌ์ง) (์ฌ์ง) "์ธ๋ฒ์งธ ๋ต๊ธ"์ ์ฌ๋ ธ๋ console.log(window.pageYOffset , document.documentElement.clientHeight , document.documentElement.scrollHeight);๊ณผ ๋ค๋ฅธ ๋ชจ์ต์ ๋ณผ ์ ์์ต๋๋ค. ์ ์๊ฐ์๋ ํน์ '0'์ด๋ ๋๊ฐ ์๋ ํฌ๊ธฐ๊ฐ ๋ณํ์ง ์์, 0 768 880์ธ ๊ฒฝ์ฐ์๋ ์กฐ๊ฑด์ ์ฑ๋ฆฝ ํ์ฌ์ ์๊ธด ๋ฌธ์ ๋ผ๊ณ ์๊ฐํ์ต๋๋คใ ใ if (window.pageYOffset + document.documentElement.clientHeight > document.documentElement.scrollHeight - 300) (์ฌ์ง) *์ถ๊ฐ์ ์ผ๋ก ๋ง์ํด ์ฃผ์ จ๋ loadPostsLoading๋ ...reducers/post.js์์๋ ์ ๊ฐ ๋จ์๋ก ๋ช ์ํ๋๋ผ๊ตฌ์ ใ ใ ์ ๋ก์ด๋์ด ์ซ์ดํ์๋ ๋จ์ ๋ณต์ ๊ท์น์ ๋ช ํํ๊ฒ ์งํค์ง ์์์ต๋๋ค ..ใ ใ ๊ทธ๋๋ ๊ฒฐ๊ณผ๋ ๋ณํจ ์์ด ๋์ค๊ณ ์์์ต๋๋ค! ใ ใ ์ด๋ฐ ์ํฉ๋ ๋ธ๋ผ์ฐ์ ์ ๋ฐ๋ผ ์คํฌ๋กค ๊ด๋ จ ๋ฒ๊ทธ ์ธ๊ฑด์ง์ ใ ใ
- 0
- 9
- 421
Q&A
์๋ ํ์ธ์
๊ทธ๋ฌ๋ค์ ใ ใ ๋ฐ๋ก ์์ console ์ฐ์ ์ฝ๋๋ ์ด๊ฑด๋ฐ.. import React, { useEffect } from 'react'; import { useSelector, useDispatch } from 'react-redux'; import PostForm from '../components/PostForm'; import PostCard from '../components/PostCard'; import AppLayout from '../components/AppLayout'; import { LOAD_POSTS_REQUEST } from '../reducers/post'; import { LOAD_MY_INFO_REQUEST } from '../reducers/user'; const Home = () => { const dispatch = useDispatch(); const { me ,logInError} = useSelector((state) => state.user); const { mainPosts, hasMorePosts, loadPostsLoading,retweetError } = useSelector((state) => state.post); useEffect(() => { if (retweetError) { return alert(retweetError); } }, [retweetError]) useEffect(() => { if (logInError) { return alert(logInError); } }, [logInError]) useEffect(() => { dispatch({ type:LOAD_MY_INFO_REQUEST }); dispatch({ type: LOAD_POSTS_REQUEST, }); }, []); useEffect(() => { function onScroll() { if (window.scrollY + document.documentElement.clientHeight > document.documentElement.scrollHeight - 300) { console.log(window.screenY,document.documentElement.clientHeight ,document.documentElement.scrollHeight ) if (hasMorePosts && !loadPostsLoading) { const lastId=mainPosts[mainPosts.length -1]?.id;//์์๊ฒฝ์ฐ๋ ์์ผ๋๊น dispatch({ type: LOAD_POSTS_REQUEST, data:lastId }); } } } window.addEventListener('scroll', onScroll); return () => { window.removeEventListener('scroll', onScroll); }; }, [mainPosts, hasMorePosts, loadPostsLoading]); return ( {me && } {mainPosts.map((c) => ( ))} ); }; export default Home; ๋ญ๊ฐ ๋ฌธ์ ์ธ์ง ์ฐพ์๋ณด๊ฒ ์ต๋๋ค ใ .ใ .......
- 0
- 9
- 421
Q&A
์๋ ํ์ธ์
์ ์ ๊ทธ๋ฌ๋๋ฉด ์ ๊ฐ ์์ ๋ฃ๊ณ ๋ณต์ต ์ฉ์ด๋ ํผ์ ์์ฑ์ฉ ์ฝ๋๋ฅผ ๋๊ฐ๋ฅผ ์จ์ ํ๋๋ฐ ๋ค๋ฅธ ์ฝ๋์์๋ document.documentElement.scrollHeigh ๊ฐ ์ฆ๊ฐํ์ต๋๋ค ใ ใ ๊ทธ๋์ ์ฆ๊ฐํด์ผ ๋๋ค๊ณ ์๊ฐํ๋ ๊ฒ ๊ฐ์ต๋๋ค ใ ใ ์ง๊ธ ์ฌ์ง์ (์ฌ์ง) (์ฌ์ง) LOAD_POSTS๋ ์์ console.log(window.screenY,document.documentElement.clientHeight,document.documentElement.scrollHeight ) ๊ฒฐ๊ณผ ์ ๋๋ค. ์กฐ๊ฑด์ ์ด๊ตฌ์ if (window.scrollY + document.documentElement.clientHeight > document.documentElement.scrollHeight - 300)
- 0
- 9
- 421
Q&A
์๋ ํ์ธ์
์ฐ์ load_post ๋๋ ์์ ์ console์ ์ฐ์ด๋ณด๋ฉด if (window.pageYOffset + document.documentElement.clientHeight > document.documentElement.scrollHeight - 300) ์ผ์์ ์ถ๋ ฅ๋๊ฒ ํ์ต๋๋ค. (์ฌ์ง) document.documentElement.scrollHeight๊ฐ ๋ณ๊ฒฝ์ด์๋๊ณ ์๋๊ฒ ๊ฐ์ต๋๋ค. ๊ทธ๋ฆฌ๊ณ ์ถ๊ฐ์ ์ผ๋ก LOAD_POSTS๊ฐ ๋์์ ์ฌ๋ฌ๋ฒ ์คํ ๋๋๊ฒ ๊ฐ์ต๋๋ค. (throttle์ if (hasMoreposts && !loadPostLoading) ์กฐ๊ฑด ์ฌ์ฉ) ใ ใ (์ฌ์ง)
- 0
- 9
- 421




