Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

这个支持路由懒加载吗? #1

Open
chinaxcy opened this issue Dec 6, 2021 · 7 comments
Open

这个支持路由懒加载吗? #1

chinaxcy opened this issue Dec 6, 2021 · 7 comments

Comments

@chinaxcy
Copy link

chinaxcy commented Dec 6, 2021

大神好!

@CJY0208
Copy link
Owner

CJY0208 commented Dec 6, 2021

支持的

@CJY0208 CJY0208 closed this as completed Dec 6, 2021
@CJY0208 CJY0208 reopened this Dec 6, 2021
@chinaxcy
Copy link
Author

chinaxcy commented Dec 6, 2021

但是我试过了,没有缓存

@chinaxcy
Copy link
Author

chinaxcy commented Dec 6, 2021

function useUpdate(): () => void {
  const [, setTrigger] = useState({})
  const update = useCallback(() => setTrigger({}), [])
  return update
}

这个方法是用于强制更新函数组件的吗?大神?

@CJY0208
Copy link
Owner

CJY0208 commented Dec 7, 2021

是的,和 ahooks 里的 useUpdate 一模一样

这个仓库还没有正式开搞,等开始做了我测一下 lazy 场景,或者你有现成 demo 的话也可以放出来瞅瞅

@chinaxcy
Copy link
Author

chinaxcy commented Dec 7, 2021

Thank you for your work with this library, very excited to put it in production.

@CJY0208
Copy link
Owner

CJY0208 commented Dec 10, 2021

可以考虑先用 react-activation 来实现 keep-alive 功能

@chinaxcy
Copy link
Author

可以考虑先用 react-activation 来实现 keep-alive 功能

好的,我试试,感谢感谢,星星送上

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

No branches or pull requests

2 participants