Skip to content

글로벌 컴포넌트#19

Open
11t518s wants to merge 2 commits into
mainfrom
feat/#16
Open

글로벌 컴포넌트#19
11t518s wants to merge 2 commits into
mainfrom
feat/#16

Conversation

@11t518s

@11t518s 11t518s commented Apr 16, 2024

Copy link
Copy Markdown
Contributor

우선 web에 토스트올려놨는데 애니매이션이나, 코드는 완성은 아님 (만족스럽지 않음..)

근데 대충 코드 흐름은 볼 수 있어서 pr올려둠!

@11t518s 11t518s requested a review from yoon-junseo April 16, 2024 16:34

@yoon-junseo yoon-junseo left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

좋다
UI만 정의해서 내보낼 때 createPortal로 묶기만 하면 동작은 알아서 제공해주는거네

앞으로 파일은 지금 구조처럼 폴더 하위에서 index.ts index.tsx로 내보내주는거로 할까 ??

"name": "@daehwahap/global-components",
"version": "0.0.1",
"private": true,
"devDependencies": {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

요런식으로 packageManager 명시해줘도 좋을듯 !
image

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

요기는 8e63da2
context 생성 관련 util을 추가해줘서 얘로 바꿔도 되겠다
바꾸는건 내가 해둘게

import { createPortal } from '@daehwahap/global-components/src/utils'
import { useEffect } from 'react'
import {
GlobalComponentContextProvider,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

이거 미사용인데 남아있다
vscode에서는 lint가 안 잡혀서 전체적으로 봐야겠다
요런건 우선 냅두고 내가 한번에 lint랑 ts 전체적으로 봐볼게


type HOCProviderProps = { children: ReactNode }

const HOCProvider = ({ children }: HOCProviderProps) => {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

아래처럼 해도 되겠다

Suggested change
const HOCProvider = ({ children }: HOCProviderProps) => {
const HOCProvider = ({ children }: PropsWithChildren) => {

Comment on lines +12 to +14
<div style={{ position: 'absolute' }}>
<Toast.Portal />
</div>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

이쪽에서 hydration error 발생하는데 createPortal에서 createElement 해주는 부분 때문인가
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants