Skip to content
This repository was archived by the owner on Oct 26, 2018. It is now read-only.

Following feedback in #259 #262

Merged
merged 4 commits into from
Feb 6, 2016

Conversation

webmasterkai
Copy link
Contributor

See issue #259.

@webmasterkai webmasterkai mentioned this pull request Feb 6, 2016
@@ -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:
Copy link
Member

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.

Copy link
Contributor Author

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?

Copy link
Member

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.

Copy link
Contributor Author

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?

Copy link
Member

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.

Copy link
Contributor Author

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?

@timdorr
Copy link
Member

timdorr commented Feb 6, 2016

Cool, I'll merge this back into the branch so it shows up in the PR for further work.

timdorr added a commit that referenced this pull request Feb 6, 2016
@timdorr timdorr merged commit 08b3818 into reactjs:synchronicity Feb 6, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants