Conversation
gangpyono
commented
Dec 21, 2021
| component={UserPageFollowList} | ||
| /> | ||
| <PrivateRoute path="/searchmain" component={SearchMain} /> | ||
| <PrivateRoute path="/searchmain/:wherefrom" component={SearchMain} /> |
Member
Author
There was a problem hiding this comment.
검색페이지를 담당하는 컴포넌트의 path주소마지막에 변수를 설정해준다.
| <SearchIcon | ||
| onClick={() => { | ||
| history.push("/searchmain"); | ||
| history.push("/searchmain/cafeboard"); |
| <SearchIcon | ||
| onClick={() => { | ||
| history.push("/Searchmain"); | ||
| history.push("/Searchmain/bulletinboard"); |
Member
Author
There was a problem hiding this comment.
자유게시판 후기메인페이지에서 이동했을떄.
| const [popUp, setPopUp] = useState(false); | ||
|
|
||
| // 검색페이지를올떄 자유게시판에서 왔는지, 카페 후기게시판에서왔는지를 판단하기위함. | ||
| const whereFrom = useParams().wherefrom; |
Member
Author
There was a problem hiding this comment.
useParans훅을 이용하여 해당하는 값을 받아올 수 있어, 이를 활용하여 분기처리시의 기준값으로 설정해줌.
Member
|
확인했습니다! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
기존에 persist를 사용하여 어떤 페이지로부터 왔는지에대한 정보를 담은 변수들을 제거하고 path주소에 변수를 설정하여 페이지를 유지시키는방식으로 변경했습니다.
최근검색목록도 로컬 스토리지에서 관리중인데 이건 서버분들이랑 api설계 떄문에 우선은 기존방식으로 설정해놓았습니다.