Closed 521xueweihan closed 1 year ago
Branch i94-_优化_首页改版 created!
点击进入项目介绍页面后返回,首页自动刷新到头部,能否考虑进入介绍页面时缓存首页内容。
猜测是不是需要一个缓存location的内容?
const location = useLocation()
const state = location.state as { backgroundLocation?: Location }
<Routes location={state?.backgroundLocation || location}>
...
<Route path={"/repo-details"} element={<RepoDetails />} />
</Routes>
// 返回列表,其实任何页面进入了详情,都是缓存的
navigate(-1)
// 导航去别的页面
navigate("others")
https://dev.to/devmdmamun/create-contextual-modal-navigation-with-react-router-v6-28k2
点击进入项目介绍页面后返回,首页自动刷新到头部,能否考虑进入介绍页面时缓存首页内容。
@WShihan 现在的项目介绍页是在新的页面中打开的,如果要返回上一个页面建议直接把当前页面关闭就可以了。
@WShihan done
HelloGitHub 社区首页正在动工改版!将围绕 更方便、增强互动、独特性 的方向进行优化,诚邀您体验后进行反馈。地址:https://hellogithub.com/
目前的改动计划:
如果您有什么建议,欢迎留言讨论。