Skip to content

Commit

Permalink
🐛 Fix: params에서 accountname을 가져오지 못하는 문제 해결
Browse files Browse the repository at this point in the history
  • Loading branch information
sy-paik committed Nov 28, 2023
1 parent 90e661b commit d8109d3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,19 @@ import {
} from './FollowerListPageStyle';

const FollowerListPage = () => {
const account = useParams().id;
const { accountname: accountName } = useParams();
const isDarkMode = useRecoilValue(isDarkModeState);
const [isLoading, setIsLoading] = useState(true);
const [followings, setFollowings] = useState([]);

useEffect(() => {
const followList = async () => {
const data = await getFollowerList(account);
const data = await getFollowerList(accountName);
setFollowings(data);
setIsLoading(false);
};
followList();
}, [account]);
}, [accountName]);

return (
<>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,20 @@ import {


const FollowingListPage = () => {
const account = useParams().id;
const { accountname: accountName } = useParams();
const isDarkMode = useRecoilValue(isDarkModeState);
const token = localStorage.getItem('token');
const [isLoading, setIsLoading] = useState(true);
const [followings, setFollowings] = useState([]);

useEffect(() => {
const followList = async () => {
const data = await getFollowingList(account);
const data = await getFollowingList(accountName);
setFollowings(data);
setIsLoading(false);
};
followList();
}, [account, token]);
}, [accountName, token]);

return (
<>
Expand Down

0 comments on commit d8109d3

Please sign in to comment.