codestates / codestates/HomeTownAlba

[21.11.23] 에러핸들링 (김지윤) - 업데이트된 DB 내용이 브라우저에 렌더링 되지 않는 경우

Open
#105 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
0
Forks
0
PR merge metrics
No merged PRs in 30d

Description

## 문제 상황 및 에러 로그
- 상황 : Axios 요청 직후 DB 변경 내용이 화면에 렌더링이 안 됨

## 해결방안
- 해결방안 : Boolean 값의 state를 선언하여, axios 요청시 해당 state가 변경되고 useEffect 실행시키기
```js
const [eventStatus, setEventStatus] = useState(false);

const eventHandler = () => {

axios 통한 Create, Update, Delete 요청
.then((res) => {
setEventStatus(!eventStatus);
});

useEffect(() => {
// 내용
}, [companyId, eventStatus]);
```

Contributor guide

No contributing guide indexed for this repository

Research direction

No source file or test is named. Start by locating the Axios Create, Update, and Delete handlers and the useEffect that depends on companyId; reproduce the missing browser update and trace the state change after the request. Done means updated database content renders in the browser after the request.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, react
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.