일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
- MongoDB
- Github Actions
- js
- React
- axios
- EC2
- Jenkins
- nodejs
- error
- MUI
- 500
- webhook
- AWS
- fastapi
- macbook
- github
- Spring
- Java
- springboot
- deploy
- linux
- python
- docker
- TypeScript
- Express
- AWS EC2
- javascript
- RDS
- Troubleshooting
- ngrok
- Today
- Total
목록React (12)
BEAT A SHOTGUN
ERROR ❌ axios.get 를 이용해 DB에 있는 게시글 데이터를 프론트에 출력하려고 했다. 에러 메세지가 표시되는 것은 아니지만 계속해서 함수를 호출하는 지 계속해서 게시글이 console 에 호출되었다. 어? 왜 계속 찍지?? 하지만 생각해보면 내가 아무것도 설정해놓지 않고 get 메서드 만을 적어놓았기 때문에 당연히 페이지가 열려있는 동안에는 계속해서 호출시키는 것 같았다. 절반의 해결 ✅ deps 를 지정하지 않아서 그런 것 같으니 [] 를 useEffect 함수 마지막에 넣어줬다. // FE useEffect(()=>{ const getReplies = async () =>{ const { data: { data: {reply}, }, } = await axios.get('http:..
ERROR ❌ // FE const handleReplyDelete(props){ console.log(props.replyId) } ... Delete onClick 이벤트를 넣은 버튼을 눌렀을 때 props 로 넣어준 reply 가 제대로 넘겨주는지 확인하기 위해 console에 replyId 를 출력하는 간단한 이벤트를 발생시켜보았다. 그런데 페이지를 Rendering 할 때 onClick 이벤트가 자동으로 작동된 뒤, 버튼을 눌러도 console 에 replyId 를 찍어주지 않았다. Rendering 할 때 작동 된 뒤로는 버튼이 전혀 반응이 없어서 너무 의아했다. 해결 ✅ {handleReplyDelete(reply)}}>Delete 이렇게 Arrow Function 을 사용해 한 번 더 함수..
ERROR ⛔ 프론트엔드에서 axios.post 로 data 를 백엔드로 보내고 백엔드는 DB로 보내려고 할 때, data 도 들어간 것 같고 백엔드 메서드도 반응을 하는데 not null property 에러가 나온다? CODE // Front const [userId, setUserId] = useState(""); const [password, setPassword] = useState(""); const [email, setEmail] = useState(""); function userSignIn(){ axios.post('http://localhost:8080/join', data:{ userId:userId, password:password, email:email }) .catch(funct..
ERROR ❌ Object { message: "Request aborted", name: "AxiosError", code: "ECONNABORTED", config: {…}, request: XMLHttpRequest, stack: "" }라는 오류가 떴다. CODE // Front const [id, setId] = useState(""); const [title, setTitle] = useState(""); function testSubmit(){ axios.get('http://localhost:8080/test/creat',{ params:{ id:id, title:title } }) .catch(function(error){ console.log("실패"); console.l..