Skip to content

Conversation

@LeeJeongHooo
Copy link
Member

📌 개요

웹뷰 초기 세팅입니다.

참고 링크

📋 변경사항

리뷰어는 '변경사항'의 요소들을 검토해주세요.

스크린샷

작업 전 작업 후

🙏 참고사항

리뷰어는 '참고사항'의 요소들을 고려해주세요.

리뷰 희망 기한

@vercel
Copy link

vercel bot commented Jan 12, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
dpm-core-client-admin Error Error Feb 6, 2026 11:37am
dpm-core-client-client Error Error Feb 6, 2026 11:37am

Copy link
Collaborator

@semnil5202 semnil5202 left a comment

Choose a reason for hiding this comment

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

넵넵 정호님, 확인했습니다. 고생많으셨습니다! 🙏

source={{ uri: 'https://core.depromeet.com' }}
onNavigationStateChange={handleNavigationChnage}
overScrollMode="never"
sharedCookiesEnabled={true}
Copy link
Collaborator

Choose a reason for hiding this comment

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

추후 Android 와 iOS 간 동작 차이 확인이 필요한 부분

@@ -1,5 +1,5 @@
import { Stack } from "expo-router";
import { Slot } from 'expo-router';
Copy link
Collaborator

Choose a reason for hiding this comment

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

  • Stack: 네이티브 앱의 표준 내비게이션(Push/Pop)을 구현하며, 기본 헤더(Header)와 화면 전환 애니메이션을 포함합니다.
  • Slot: 단순히 현재 경로에 맞는 컴포넌트를 렌더링하는 빈 컨테이너(Empty Placeholder) 역할만 수행합니다. (React Router의 과 유사)

UI 제어권 및 "Double Header" 방지

  • Stack: 기본적으로 상단 내비게이션 바(뒤로 가기 버튼, 타이틀)를 강제합니다. 웹 서비스 내에 이미 GNB/Header가 있다면, 앱 헤더와 웹 헤더가 동시에 뜨는 이중 헤더 문제가 발생합니다.
  • Slot: 아무런 UI 래퍼(Wrapper) 없이 자식 컴포넌트(index.tsx)를 그대로 노출하므로, 화면 디자인을 100% 웹뷰가 주도할 수 있습니다.

내비게이션 히스토리 관리 주체

  • Stack: 앱 자체의 history stack을 관리합니다. (A 화면 → B 화면 이동 시 쌓이는 구조)
  • Slot: 단순히 URL에 매핑된 컴포넌트만 교체합니다. 웹뷰 앱은 페이지 이동이 앱 레벨이 아닌 웹뷰 내부 URL 변경으로 일어나므로, 앱 레벨의 스택 관리가 불필요하거나 충돌할 수 있습니다.

Copy link
Collaborator

Choose a reason for hiding this comment

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

추후 네이티브 지면이나 로그인 화면을 별도로 구축해야 한다면, 최상위를 Slot 대신 Stack으로 감싸고 핸들링이 필요하겠네요.

Modal Group 이런것도 활용은 가능하겠군요.. (복잡해지겠지만)

Copy link
Member Author

Choose a reason for hiding this comment

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

새로운 네이티브 지면이 생길 수 있다고 생각해서 Slot에서 Stack구조로 다시 변경하였습니다!

return () => backHandler.remove();
}, [canGoBack]);

const handleNavigationChnage = (navState: WebViewNavigation) => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

change 오타난 것 같아요! cspell 프로젝트에 도입하는 것도 괜찮겠네요.

Copy link
Member Author

Choose a reason for hiding this comment

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

오타난 부분 수정했습니다!

flex: 1,
}}
ref={webViewRef}
source={{ uri: 'https://core.depromeet.com' }}
Copy link
Collaborator

@semnil5202 semnil5202 Jan 13, 2026

Choose a reason for hiding this comment

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

요거 개발 환경 핸들링하는 env (ex: NEXT_PUBLIC_STAGE) 등으로 유틸 함수 만들어서 환경 분기해서 적용하면 좋을 것 같네요!

if(NEXT_PUBLIC_STAGE === 'development') return 'https://core.depromeet.shop';
retrun 'https://core.depromeet.com';


export default function Home() {
const webViewRef = useRef<WebView>(null);
const insets = useSafeAreaInsets();
Copy link
Collaborator

Choose a reason for hiding this comment

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

요 친구와 css env 와 무슨 차이가 있나요??

Copy link
Collaborator

Choose a reason for hiding this comment

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

확인해보니,

useSafeAreaInsets (현재 코드): **앱(Native Container)**이 노치를 피합니다. 웹뷰가 노치 아래서부터 시작됩니다.

CSS env(): **웹 콘텐츠(Web)**가 노치를 피합니다. 웹뷰는 화면 꽉 차게(노치 뒤까지) 그려집니다.

라고합니다. 그리고 스타일 이슈가 생겼을 때 관리 주체가 웹이 더 편할 것 같은데.. 이건 우선 위와 같이 적용해보고 논의해보시죠.

  • Immersive UI 적용을 고려한다면 env CSS 로 전환이 필요함.

변경한다면, 아래처럼 변경할 것

현재의 paddingTop: insets.top 코드를 제거하고,

웹뷰 스타일을 flex: 1로 유지한 뒤,

웹(Web) 프로젝트의 CSS에 padding-top: env(safe-area-inset-top);을 적용

Comment on lines 11 to 22
useEffect(() => {
const onBackPress = () => {
if (canGoBack && webViewRef.current) {
webViewRef.current.goBack();
return true;
}
return false;
};

const backHandler = BackHandler.addEventListener('hardwareBackPress', onBackPress);
return () => backHandler.remove();
}, [canGoBack]);
Copy link
Collaborator

Choose a reason for hiding this comment

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

아 ~ iOS는 하드웨어 뒤로가기가 없는데, 안드로이드는 있어서 이렇게 로직을 작성해도 iOS 까지 영향이 없군요.

아마 기본값 같은데, Webview 컴포넌트에

allowsBackForwardNavigationGestures={true}

속성 넣어주는걸 권장하는군요. (개인적으로는 좀 회의적이긴 합니다. → 아직 잘 몰라서)

Copy link
Member Author

Choose a reason for hiding this comment

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

해당 속성도 추가하였습니다!

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

Labels

⚙ Chore 개발 환경 세팅

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants