-
Notifications
You must be signed in to change notification settings - Fork 641
Conversation
@@ -73,7 +73,7 @@ ReactDOM.render( | |||
) | |||
``` | |||
|
|||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Listen to the history. It's a synchronous operation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.