[Trouble Shooting] 로딩 상태 관리 - splash screen이슈
#138
sgoldenbird
started this conversation in
Trouble Shooting
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
🐞 문제 상황 (Problem Description)
앱 진입 시 꽤 오래 흰 화면이 보이며 UX 관점에서도 이질감을 줄 수 있는 초기 화면 전환 문제가 있었다.
이를 보완하기 위해 splash screen을 만들어 초기 로딩 상태 또는 새로고침 상태일 때 띄우기로 했다.
처음에는 index.html에서 직접 static splash screen을 띄우는 방식으로 초기 로딩 화면을 구현했지만,
이 방식은 React 앱 외부에서 동작하며, React Router 기반의 페이지 구조와 분리되어 있어 구조적으로 어색하고 유지보수에 불리한 점이 있었다.
💻 환경 정보 (Environment)
🔍 발생 원인 분석 (Investigation)
🛠 시도해본 해결 방법 (Attempts)
navState === 'idle'기준으로 처리✅ 최종 해결 방법 (Final Solution)
초반에 흰 화면이 나타나고, 별이 굴러가다 끝남에도 react-router를 통해 routing 처리를 하고 있는데 관련 코드가 index.html에 동떨어져있는 것이 좋아보이지 않고, 이후에도 splash 관련 동작을 상태나 로딩 흐름과 연계하려면 React 내부에서 통합 관리하는 편이 유지보수에 용이하다고 판단
useNavigation()훅으로 가져온 navState가 idle이 되면 splash screen이 꺼지는 로직을 구현결과적으로 구조적으로 더 일관되고 유지보수 가능한 방식으로 전환되었고, 사용자 입장에서도 덜 어색한 초기 화면 흐름을 제공

splash.mp4
💡 알게 된 점 (Lessons Learned)
📚 래퍼런스
Beta Was this translation helpful? Give feedback.
All reactions