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

components with router? #37

Open
serapath opened this issue Jul 30, 2016 · 1 comment
Open

components with router? #37

serapath opened this issue Jul 30, 2016 · 1 comment

Comments

@serapath
Copy link

Hey,

I was just building a little experiment page, that includes a chat, an editor and and a news component.

The news component

  • is a standalone component that can be its own page
  • has some buttons to show and navigate to different news pages
  • represents the current view state, thus the subpage navigated to, in the browser url

The editor component

  • is a standalone component that can be its own page.
  • has some buttons to show and navigate to different news pages
  • represents the current view state, thus the subpage navigated to, in the browser url

The chat component

  • is a standalone component that can be its own page.
  • has some buttons to show and navigate to different news pages
  • represents the current view state, thus the subpage navigated to, in the browser url

If I combine those components on a new page, that has it's own navigation bar, is there a way to re-use the router information of the standalone components?

I was thinking, that some mechanism would allow me to mount all routes of those 3 components at:

  • /chat/...
  • /editor/...
  • /news/...

The problem I'm seeing is, that no matter which subpage is active in any of the components, there needs to be a way to maintain the current "location.href" of the other components too.

  • Did you or anyone think of components that have their router baked in?
  • What do you think in general about this idea?
@yoshuawuyts
Copy link
Owner

I hadn't really thought of this for my own use cases, but I think it quite makes sense for more complex widget-like components. sheet-router is a functional data structure, so if you know what you're passing in you get to choose your own method of persisting that data before passing it in so you could do what you described. Does that make sense? Cheers!

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