Posts
Q&A
HOC ๊ด๋ จ ์ง๋ฌธ์ ๋๋ค.
์ ๋ ๊ณ ๋ฏผํ๋ค๊ฐ https://www.inflearn.com/questions/36142 ์ ๋งํฌ์ ๋ต๋ณ๋จ ๊ฒ ์ฒ๋ผ ํด๊ฒฐํ๋๋ฐ ํ์ด์ง ๋ง๋ค ์กฐ๊ฑด์ฒ๋ฆฌ ํด์ค์ผ ํ๋์ง ๊ถ๊ธํด์.. ์๋๋ฉด ๋ค๋ฅธ ๋ฐฉ์์ด ์์๊น์
- 1
- 1
- 207
Q&A
๋ก๊ทธ์์ ๊ด๋ จ ์ง๋ฌธ ์์ต๋๋ค.
์ ๊ฐ ํ ์ ํจ์๊ฐ ์ ์ฉ์ํจ ์ฝ๋ ๊ณต์ ํฉ๋๋ค. ํ ํฐ ๋ง๋ค ๋ ์ธ์๋ก ์ ํจ์๊ฐ ๋๊ฒจ์ค ์ ์๋๋ผ๊ณ ์ var token = jwt.sign({id: user._id.toHexString()},'secretToken', {expiresIn: '1h'}); ์ ์ฉํ๋ฉด auth ๊ถํ ํ์ธํ๋ ๊ณณ์์ ์ค๋ฅ๊ฐ ๋ ์ ์๋๋ฐ ์๋ ์ฒ๋ผ ์์ ํ์ด์ jwt.verify(token, 'secretToken', function(err, decoded){ // ๋ณตํธํ๋ ํ ํฐ decoded if(decoded){ user.findOne({"_id":decoded.id, "token":token}, function(err, user){ if(err) return cb(err); cb(null, user); }) }else{ cb(null); }
- 0
- 1
- 192
Q&A
useSelector๋ฅผ ์ฌ์ฉํ์ฌ store ๊ฐ ๊ฐ์ ธ์ค๊ธฐ
import {useSelector} from 'react-redux' const user = useSelector(state => state.user.userData); console.log('userselect', user) store์ ์ ์ฅํ state ๋ช ์ด ๋ฌ๋ผ์ ๊ทธ๋ฐ๊ฑฐ ์๋๊น์? ์ ์๋๋ค์..
- 0
- 2
- 2.7K
Q&A
TypeError: Cannot read property 'prototype' of undefined
ํน์ response ๋ฐ์์ค๋ ํ์ด์ง์์ import ๋ถ๋ถ์ response๊ฐ ์๋์ผ๋ก ์ถ๊ฐ๋์๋์ง ํ์ธํด๋ณด์ธ์~
- 0
- 1
- 413
Q&A
๋ก๊ทธ์ธ์ ๋ฉ๋ด๋ฅผ ์ ํํ์๋...
์ ๋ ์ด๊ฑฐ ํด๊ฒฐํด๋ณด๊ณ ์ ๊ฒ์ ํด๋ดค๋๋ฐ user๊ฐ undefined์ผ ๋ ์กฐ๊ฑด์ ์ค์ ํด๊ฒฐํ์ต๋๋ค. if(user.userData === undefined){ return null; }else{ if (user.userData && !user.userData.isAuth ) { return ( Menu mode={props.mode}> ํน์ ํ์ด์ง์ ๊ถํ์ ์ฃผ๊ณ ๋ค์ด๊ฐ๋ redirect ํ๊ธฐ ์ ์ ์ ๊น ๋ณด์ฌ์ง๋๋ฐ ์ด๋๋ ๋๊ฐ์ด ์ ์ฉํ์ด์.. (๊ทธ๋ฐ๋ฐ ๊ถํ์๋ ํ์ด์ง๋ง๋ค ์ด๋ ๊ฒ ํด์ค์ผํ๋๊ฑด์ง..?) if(!props.user.userData.isAuth){ return null; }else{ return ( div style={{ width: '100%' }}> {console.log("engine landing")} Layout style={{ padding: '0 24px 24px', overflow: 'auto' }}>
- 0
- 2
- 208
Q&A
์ง๋ฌธ์์ต๋๋ค!
์ loadmoreHandler์ body์์ Filter ์ถ๊ฐํด์คฌ๋๋ ๋๋ค์. loadmore์ ํํฐ๊ฐ ์์ด์ ์กฐ๊ฑด์์ด ๋ชจ๋ ๋ฐ์ดํฐ๋ฅผ ๊ฐ์ ธ์์ ์๋ฅด๋ ๊ฒ ๊ฐ์์ const loadmoreHandler = () => { let skip = Skip + Limit; let body = { skip: skip, limit: Limit, loadMore: true, filters: Filters } getProducts(body); setSkip(skip); }
- 0
- 2
- 191
Q&A
Service Account ์์ ๋ ํด๊ฒฐ ๋ฐฉ๋ฒ
๊ฐ์ฌํฉ๋๋ค~
- 21
- 1
- 608
Q&A
๋ต๊ธ์ด ๋๋ฌ๋ ๋์ค์ง์์ต๋๋ค.
์๋ ์ง๋ฌธ ๊ธ์๋ ์์ง๋ง const renderReplyComment = (parentCommentId) => { ์ฌ๊ธฐ์ {} ๋์ () ์ฌ์ฉ or { return ... }
- 0
- 2
- 272
Q&A
์์์คํ์ ์์์ด ์ข์ฐ๋ก ๋จ๋ฆฌ๋ค์
์คํฌ๋กค๋ฐ ๋ฌธ์ ๊ฐ์๋ฐ ์ ๋ฐ์ํ๋์ง๋ ๋ชจ๋ฅด๊ฒ ๋ค์ ใ ใ ์คํฌ๋กค๋ฐ ๊ณ ์ ํ๋ฉด ๊ด์ฐฎ์ ์ง๋๋ฐ ์์ธ์ด ๋ญ๊น์? body { overflow-y: scroll; }
- 0
- 4
- 360
Q&A
localhost 3000 ์ ์ ์ค๋ฅ
์ ๊ฒฝ์ฐ์ ๋ก๊ทธ์ bcrypt ์๋ฌ๊ฐ ๋ ์์ด์ ๋ก๊ทธ์ธ์ด๋ ํ์๊ฐ์ ์ด ์๋์์ด์.. mongoDB ๊ฐ์ ์ง๋ฌธ์ ์กด๋์ด ์ฌ๋ฆฌ์ ๋ต๋ณ ๋ฐ๋ผํ๋๊น ํด๊ฒฐ๋๋ค์
- 0
- 5
- 1K