Following feedback in #259#262
Conversation
| ``` | ||
|
|
||
| Now you can read from `state.routing.location.pathname` to get the URL. It's far more likely that you want to change the URL more often, however. You can use the `push` action creator that we provide: | ||
| Now you can read from `state.routing.locationBeforeTransitions.pathname` to get the URL. It's far more likely that you want to change the URL more often, however. You can use the `push` action creator that we provide: |
There was a problem hiding this comment.
User are discourage from reading state at all. I'm thinking of prefixing this key with a $ to make that clear. But this section of the README should actually go away or be significantly changed.
There was a problem hiding this comment.
What's the solution for users that refuse to define routes in jsx within a react component? Where should a user parse the location so they can get things like named path parameters using a tool like url-pattern?
There was a problem hiding this comment.
Router hasn't had named routes for a while now. You should be using URLs or location descriptors for all of your navigation.
There was a problem hiding this comment.
I'd like to make a simple example that does not use react-router. How do I gain access to the location.pathname?
There was a problem hiding this comment.
Listen to the history. It's a synchronous operation.
There was a problem hiding this comment.
Isn't that the point of this library? To listen to history and put it in the same place where every other component reads state from?
|
Cool, I'll merge this back into the branch so it shows up in the PR for further work. |
See issue #259.