Skip to content

router-view is functional component which should not be used with keep-alive #3701

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

Closed
yuwu9145 opened this issue Jan 18, 2022 · 1 comment
Closed

Comments

@yuwu9145
Copy link

yuwu9145 commented Jan 18, 2022

Version

3.5.3

Reproduction link

github.com

Steps to reproduce

According to keepAlive official doc

keep-alive does not work with functional components because they do not have instances to be cached.

However, according to router-view doc, RounterView is a functional component.

this results in issue which can be reproduced in vuejs/core#5207

What is expected?

RounterView should work correctly with keep-alive

What is actually happening?

RounterView does not work correctly with keep-alive and two official documents are contradictive.

@LinusBorg
Copy link
Member

  1. You are in the wrong repository. VueRouter 4 lives art https://github/vuejs/router
  2. You have read the wrong docs, which until very soon still live at next.router.vuejs.org
  3. The quote from the docs talks about KeepAlive wrapping a functional component directly. It does not mean any nested child

Please open a new issue in https://github.com/vuejs/router if you still think this needs to be adressed in the router.

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