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
timdorr merged 4 commits intoreactjs:synchronicityfrom
webmasterkai:synchronicity
Feb 6, 2016
Merged

Following feedback in #259#262
timdorr merged 4 commits intoreactjs:synchronicityfrom
webmasterkai:synchronicity

Conversation

@webmasterkai
Copy link
Copy Markdown
Contributor

See issue #259.

@webmasterkai webmasterkai mentioned this pull request Feb 6, 2016
Comment thread README.md
```

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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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