You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jul 19, 2019. It is now read-only.
I have a question about organising sub components.
Let's say we have a very common used popup component Auth, we want to use it in different pages like home page and repo page, if we use actions like click to load the Auth that will be pretty easy, so we can load the same Auth component in different pages.
What I want to know is if we can use router to do this job, so we can manage the Auth component by router and easy to go forward and go back and even can be trigger by outer link.
Suppose we have the home page with url /home and the repo page with url /repo, we want to use the Auth popup in both these two pages, is it a good practice to handle this job by push a sub url /auth to the current url and make it to /home/auth and /repo/auth?
When I have plenty shared sub components and I want to share them in plenty parents component, I have to put all sub components in every parents route.
I don't know if is a good idea to mount the sub components in a root route.
If there are some params in the parents route like /home?email=some@do.com, is that a bad idea to add a sub url to it and make it to /home/auth?email=some@do.com but still pass the param to home route instead of auth route?
If you have some good ideas about the shared sub components work with different parents Routes kind of thing, please help ~ Thanks a lot in advance!
The text was updated successfully, but these errors were encountered:
I have a question about organising sub components.
Let's say we have a very common used popup component
Auth
, we want to use it in different pages like home page and repo page, if we use actions likeclick
to load theAuth
that will be pretty easy, so we can load the sameAuth
component in different pages.What I want to know is if we can use router to do this job, so we can manage the
Auth
component by router and easy to go forward and go back and even can be trigger by outer link.Suppose we have the home page with url
/home
and the repo page with url/repo
, we want to use theAuth
popup in both these two pages, is it a good practice to handle this job by push a sub url/auth
to the current url and make it to/home/auth
and/repo/auth
?Now I implemented this by
and
The problem is
/home?email=some@do.com
, is that a bad idea to add a sub url to it and make it to/home/auth?email=some@do.com
but still pass the param to home route instead of auth route?If you have some good ideas about the shared sub components work with different parents Routes kind of thing, please help ~ Thanks a lot in advance!
The text was updated successfully, but these errors were encountered: