Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AUD-82] AppPortal 유틸 공용 컴포넌트 제작 #48

Merged
merged 3 commits into from
Feb 24, 2024

Conversation

RookieAND
Copy link
Collaborator

@RookieAND RookieAND commented Feb 24, 2024

📃 변경사항

  • 페이지 상단에 뜨는 Toast, SnackBar, Modal 과 같은 컴포넌트를 렌더링하는 별도의 Poral 을 제공하는 AppPortal 컴포넌트를 제작했습니다.
  • 라우트 별 페이지 상단에 별도의 Element 를 생성하고, 이후 createPortal 을 사용하여 Wrapper 내부 children 컴포넌트를 렌더링 하도록 합니다.
  • Provider, Wrapper 로 구현부를 분리하고 Wrapper 를 사용하여 Portal 내부에 렌더링할 요소를 children 으로 넣도록 설계했습니다.
스크린샷 2024-02-24 오후 9 35 39

🫨 고민한 부분 (optional)

  • 하나의 Portal 에 여러 컴포넌트를 사용하도록 유도했으나 여러 개의 Portal 이 굳이 필요할까 싶었습니다.
  • 하지만 Portal 내부에서 Index 를 별도로 제어하면 괜찮다고 판단하여 이러한 결정을 내리게 되었습니다. (관리 포인트 축소도 되고요)

💫 기타사항 (optional)

  • AppPortal 사용 방식은 아래와 같습니다.
const Modal = () => (
    <AppPortal.Wrapper>
        <Modal.Wrapper>
                <p> 테스트 모달 </p>
        </Modal.Wrapper>
    </AppPortal.Wrapper>
)

@RookieAND RookieAND added the ✨ Feature 기능 개발 label Feb 24, 2024
@RookieAND RookieAND self-assigned this Feb 24, 2024
Copy link
Member

@KimGaeun0806 KimGaeun0806 left a comment

Choose a reason for hiding this comment

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

좋습니다!
Portal 사용으로 토스트와 스낵바 사용 시 전체 리렌더를 막을 수 있겠네요

@RookieAND RookieAND merged commit 2f25005 into develop Feb 24, 2024
1 check passed
@RookieAND RookieAND deleted the feature/AUD-82 branch February 24, 2024 14:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨ Feature 기능 개발
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants