Comments (1)
새로고침을 하게되면 뒤로가기 버튼이 사라지게 되는데
이 말씀과 영상을 보니 history-sync-plugin
을 사용중을 가정하고 답변하겠습니다.
이 라이브러리는 내부에서 windows
가 존재할 경우 BrowserRouter
를 사용하고 있습니다. 이는 history API 기반으로 되어 있어 새로고침 할 경우 history context를 모두 날리게 됩니다(보안 이슈로 history API에 전 화면의 주소는 가져오지 못합니다).
이에 대응하는 방법은 두가지가 있습니다.
[email protected]
패키지의createMemoryHistory
를 통해 localStorage에 저장하여 history context를 저장해 새로고침 시 history context를 복구하는 history 객체를 만든다.history-sync-plugin
의 옵션에 삽입하면 완료.- 커스텀 history를 만든다.
앱 위에서 작동하는 것이라면 새로고침을 방지하는 것 또한 좋은 방법이 될 것 같습니다. 혹여나 무조건 새로고침을 해야하는 상황이라면 위 방법을 검토해보세요 :)
from stackflow.
Related Issues (20)
- Nested Route Support
- History API Interop with `plugin-history-sync` HOT 1
- 명령형 구성 인터페이스 HOT 1
- `stepPush()`로 이동한 화면에서 `replace()` 수행시 스텝 삭제하기 HOT 1
- 질문 - Stackflow와 새로고침 HOT 2
- window check HOT 2
- test code HOT 1
- new custom hook (useRefs)
- [IOS] 기본 뒤로가기 스와이프시 레이아웃 깨짐 HOT 4
- 도큐먼트 개선
- Bug report(history-sync): Pop multiple and replace screen trigger history sync error. HOT 1
- feature request(basic-ui): Change navigating animation with replace event to none. HOT 2
- stackflow를 사용해서 개발을 하려고합니다만 몇 가지 질문 사항이 있습니다.
- stackflow를 사용해서 개발을 진행하기 전에 제가 생각한 기능들이 가능한지에 대해 질문 남깁니다. HOT 1
- `@stackflow/plugin-history-sync` 에서 앞으로 가기 지원 안 함 HOT 4
- `@stackflow/plugin-history-sync` 에서 push 혹은 pop할 url 알아오기 HOT 1
- 빌드 가이드에 사용 Node.js 버전이 명시되면 좋겠습니다.
- Next.js 12에서 사용했을 때 dynamic import 시 화면전환 애니메이션 이슈 HOT 4
- SSR 환경에서 새로고침시 액티비티 상태 유지 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from stackflow.