-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Feat: 공용 모달 컴포넌트 추가 * Refactor: 불필요 코드 제거 * Refactor: 불필요 코드 제거 * Feat: layout에 Portal 위치 추가 * Refactor: 불필요 코드 제거 * Refactor: CreatePortal 임포트 방식 변경 및 포탈 성능 개선 * Refactor: 추론 가능한 타입 지정 코드 제거 * Chore: import문 띄어쓰기 수정 * Fix: 미사용 import 삭제 및 dependency list 추가 * Design: 버튼 비활성화 스타일 추가 * Refactor: ModalButton 비활성화 속성 추가 * Fix: 프리티어 줄바꿈 에러 수정
- Loading branch information
1 parent
be3e7b6
commit 163ebb7
Showing
3 changed files
with
9 additions
and
5 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,18 @@ | ||
import { ReactNode } from 'react'; | ||
import ReactDOM from 'react-dom'; | ||
import { createPortal } from 'react-dom'; | ||
|
||
interface Props { | ||
children: ReactNode; | ||
} | ||
|
||
const ModalPortal = ({ children }: Props) => { | ||
if (typeof window === 'undefined') { | ||
return null; | ||
} | ||
|
||
const el = document.getElementById('modal-root') as HTMLElement; | ||
|
||
return ReactDOM.createPortal(children, el); | ||
return createPortal(children, el); | ||
}; | ||
|
||
export default ModalPortal; |
This file contains 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
This file contains 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