Skip to content

Commit

Permalink
REFACTOR: 불필요한 할당 및 로직 삭제
Browse files Browse the repository at this point in the history
  • Loading branch information
cyberjam committed Jul 9, 2023
1 parent 06a1030 commit d99d789
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/Home.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,14 @@ function Home() {

const handleSearchBank = (event) => {
event.preventDefault();
const target = bankInfos.filter(
(bankInfo) => bankInfo["지점명"] === targetBank
)[0];
setTargetBankInfo(target);
setTargetBankInfo(
bankInfos.find((bankInfo) => bankInfo["지점명"] === targetBank)
);
};

useEffect(() => {
const fetchBankInfos = async () => {
const data = await fetchBankData();
setBankInfos(data);
setBankInfos(await fetchBankData());
};
fetchBankInfos();
}, []);
Expand Down

0 comments on commit d99d789

Please sign in to comment.