Skip to content

Conversation

@hhhyyo
Copy link
Contributor

@hhhyyo hhhyyo commented Mar 11, 2022

PR Type

What kind of change does this PR introduce?

  • 버그를 수정했어요.
  • 새로운 기능을 추가했어요.
  • 코드 스타일 업데이트를 했어요(포맷팅, 지역변수)
  • 리팩토링을 했어요 (기능적인 변화 없이, api 변경 없이)
  • 환경설정을 변경했어요.
  • 문서 내용을 변경했어요.
  • 기타 사항을 설명해 주세요.

Related Issues

#31

What does this PR do?

Layout 만들기
Home 만들기
Search 만들기
MyRecipes 만들기
PageNotFound 만들기
Modal 만들기
라우팅

Other information

@hhhyyo hhhyyo self-assigned this Mar 11, 2022
@hhhyyo hhhyyo added 🌟 feature 새로운 기능을 만들어요! ✈️ migration 마이그레이션 작업을 진행해요! labels Mar 11, 2022
@hhhyyo hhhyyo added this to the Sprint1 milestone Mar 11, 2022
Copy link
Contributor

@hustle-dev hustle-dev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

수고하셨습니다.


function App() {
const location = useLocation();
const state = location.state as { backgroundLocation?: Location };
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

React Router DOM에서 원래 이런식으로 사용하는 지 궁금합니다!(단언문 형태로)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이 부분은 제가 공식문서의 예제를 보고 참고했습니다.
https://reactrouter.com/docs/en/v6/examples/modal

import PageNotFound from 'pages/PageNotFound/PageNotFound';

function App() {
const location = useLocation();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

useLocation으로 반환하는 값이 어떤것이죠?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

useLocation은 location 객체를 반환하는데 이런 프로퍼티를 가지고있습니다.

location: {
pathname: string;
search: string;
hash: string;
state: unknown;
key: string;
};

참고링크: https://github.com/remix-run/history/blob/main/docs/api-reference.md#location

@hustle-dev hustle-dev merged commit 3a8fa65 into TeamCooks:main Mar 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🌟 feature 새로운 기능을 만들어요! ✈️ migration 마이그레이션 작업을 진행해요!

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants