nkbt / component-router

Redux-based component routing solution
https://nkbt.github.io/component-router
MIT License
93 stars 7 forks source link

React-Router example #40

Closed nkbt closed 8 years ago

nkbt commented 9 years ago

Show how Component Router can work together with react-router.

nkbt commented 9 years ago

@halhenke how do you feel about this one? Sounds interesting to do?

halhenke commented 9 years ago

Yeah I could have a go - is this just documentation or do we want to make an example app that combines them?

nkbt commented 9 years ago

Example app would be ideal. You can take for example FooBar example and extract it into a separate repo. But you can try to make one inside Examplesfolder as well.

nkbt commented 9 years ago

https://github.com/in-flux/example-with-react-router just created an empty repo for this. Add react-component-template to it as a remote, so you will have all the basics there

nkbt commented 9 years ago
git remote add template git@github.com:nkbt/react-component-template.git
merge --no-ff --no-edit template/master
halhenke commented 9 years ago

OK sounds good. Will try and get started tonight probably (Have to look into react-router a bit also - never used it).

Speaking of examples - was just wondering about the x & y query parameters from the "Random Links" current example app that are never removed from the URL because there isnt a corresponding ComponentRouter/namespace. Is that something that we might want to fix or is that an intentional thing to show the persistence of state across page changes?

nkbt commented 9 years ago

Ha! Everyone asks about it. It is sort of intentional, shows that we do not remove existing query params unless they were added by ComponentRouter component itself.

RR is fairly easy to deal with. Actually if you make an example and find it is not working right away - still submit it and make a separate issue to fix it. I suppose something should be broken with HTML4 navigation mode. Though HTML5 should Just Work (tm)

halhenke commented 9 years ago

Ah makes sense :-)

Would be a pretty impressive demo to see them working together. Will get on it.

nkbt commented 9 years ago

:+1:

halhenke commented 9 years ago

Just to keep you up to date - have been playing with this and am having (different) issues with both HTML4 and HTML5 mode. Might just be the particular way I ended up putting it together - at any rate will push the example later tonight so you can have a look.

nkbt commented 9 years ago

Would be awesome, thanks! I'd really like to see what issues are, so probably would be able to either fix them or use RR+CR in a certain non-breaking way

halhenke commented 9 years ago

Yeah it might just be a configuration thing. The HTML4 stuff seems to basically be about both trying to manage/react to the path portion of the URL (which i see is something you are working on removing #64 ). I very quickly ended up with paths like this: http://localhost:8080/?baz=bar&page=foobar#/?baz=foo&page=foobar

With HTML5 I am getting full page unload/reloads after travelling through the app in some orders but not others. Really not sure where its coming from at this stage. Anyway will put code up later.