Live data from Hacker News

React Router: Declarative Routing for React

reacttraining.com

41–50 of 68 posts

Re: React Router: Declarative Routing for React

#41
post #9

The docs are super good. I love the "embedded browser" that shows how it works. Shameless self plug: our book [1] has a whole chapter on Routing in React with this new v4 router. After you've finished reading the docs, if you want a tutorial style walk-through of this router v4, we build a Spotify-type clone over the course of 75+ pages. [1]: https://www.fullstackreact.com

Over the last month (or so), I've been reading and reviewing React books on my blog [1]. I liked Fullstack React, but there is one big thing that keeps me from recommending it: most of the examples still use the createClass from ES5. For learning React in 2017, I (just my opinion) expect the book to fully embrace ES6/7 in all the examples. [1]: https://medium.com/@jmcunningham/

Yes, we're fixing that as we speak. It will be up to date shortly.

Re: React Router: Declarative Routing for React

#42

Will there be a way to access query / search parameters? The URL Parameters example could benefit from a such an addition, if it's already possible. Something showing how to get the genre out of `/netflix?genre=mystery` would be lovely.

I believe what you're looking for is `location.query` which can be accessed by children of your router (via `this.props.location.query`)

Thank you, I'll give that a try. The closest I saw in the current docs was via the `history` object, which I'd then have to provide to ``, which seemed sad. Using the props makes more sense! It looks like I want to use `withRouter` to get access to the location prop.

Re: React Router: Declarative Routing for React

#43
post #3

I definitely like the way they decided to move in the latest version. I never was comfortable with the previous API -- it just didn't feel right, and it was kind of restrictive.

Neither were we >.< but we were learning React along with everybody else! You'll love this version.

In my experience, loving the new version is not an understatement. Great work, and thank you. It's been a pleasure to see React and the ecosystem around it mature.

Re: React Router: Declarative Routing for React

#44
post #7

I look forward to the next API revision. Churning your API frequently turns me off as a developer who would rather not be deprecated out the gate.

0.13 -> 1.0 was breaking 1.0 -> 2.0 was fully BC

That was 2 years with only one breaking change.

2.0 -> 3.0 removed deprecated 1.0 API, fully BC with 2.0

The only churn is for people who don't stick to stable releases, and that's their own problem.

Re: React Router: Declarative Routing for React

#45

Earlier quoted context omitted.

Over the last month (or so), I've been reading and reviewing React books on my blog [1]. I liked Fullstack React, but there is one big thing that keeps me from recommending it: most of the examples still use the createClass from ES5. For learning React in 2017, I (just my opinion) expect the book to fully embrace ES6/7 in all the examples. [1]: https://medium.com/@jmcunningham/

Yes, we're fixing that as we speak. It will be up to date shortly.

I am considering buying this for an engineer that works for me to get up to speed on React in the very near future. I only want to start him on ES6+ syntax though. How long do you think until it will be up-to-date?

Re: React Router: Declarative Routing for React

#46
post #7

I look forward to the next API revision. Churning your API frequently turns me off as a developer who would rather not be deprecated out the gate.

0.13 -> 1.0 was breaking 1.0 -> 2.0 was fully BC That was 2 years with only one breaking change. 2.0 -> 3.0 removed deprecated 1.0 API, fully BC with 2.0 The only churn is for people who don't stick to stable releases, and that's their own problem.

v2.0.0 released this on Feb 10, 2016

v3.0.0-alpha.1 released this on May 19, 2016

v3.0.0-alpha.3 released this on Aug 2, 201

v3.0.0-beta.1 released this on Sep 16, 2016

v4.0.0-0 released this on Sep 13, 2016

v3.0.0 released this on Oct 24, 2016

> ... and that's their own problem.

Hence deprecation right out the gate. V4 is much better, great work - but blaming users for API churn does not make me confident. Sure users could have used a stable release, but then upgrade twice? What confidence is there that it won't churn again?

Re: React Router: Declarative Routing for React

#47
I was going to complain about churn and such, but we've all heard the JavaScript framework fatigue story a thousand times.

I'll summarize it to this: don't expect a solid, stable, boring library to come out of someone's hobby project.

React itself bloomed under Facebook's stewardship, while all the other libraries in the ecosystem are bouncing all over the place without anything to keep them in place, especially after they lose their initial shine and geek points.

Kudos to the authors for their achievements. I don't recall you promising anything to anybody, so any code you put out contributes something to the world, even if you get bored and change the API from procedural to declarative and back three times a day.

Re: React Router: Declarative Routing for React

#48

Will there be a way to access query / search parameters? The URL Parameters example could benefit from a such an addition, if it's already possible. Something showing how to get the genre out of `/netflix?genre=mystery` would be lovely.

Actually it's`match.params.genre` with a route like this `` You can see it in these examples https://reacttraining.com/react-router/examples/url-params https://reacttraining.com/react-router/examples/ambiguous-ma...

Re: React Router: Declarative Routing for React

#49
post #13

The website is broken on mobile - elements overlap and content is not visible.

Slightly off topic, but do you find that docs really need to be mobile friendly? I'd personally rather the developer focuses on the actual project and all those concerns rather than a perfect responsive docs page. Esp when assuming most of these docs are eventually translated into markdown on github which are then mobile friendly.

Yeah, I tend to research docs and libraries on-the-go, so working mobile documentation really helps me out.

Re: React Router: Declarative Routing for React

#50

Will there be a way to access query / search parameters? The URL Parameters example could benefit from a such an addition, if it's already possible. Something showing how to get the genre out of `/netflix?genre=mystery` would be lovely.

Actually it's`match.params.genre` with a route like this ` ` You can see it in these examples https://reacttraining.com/react-router/examples/url-params https://reacttraining.com/react-router/examples/ambiguous-ma...

I'm not sure I understand you. I'm asking for query parameters (`/foo?genre=mystery`), sometimes called search parameters, not URL parameters (`/foo/genre/mystery`).

I referenced the URL Parameters example in my original question and gave an example of what I meant, so I'm unsure how I could have communicated more clearly. That leads me to think that you are trying to answer my question and I'm not seeing it, but neither of the links you provided seem to show any URLs with a querystring at the end, after a `?`. Please let me know what I'm missing.

Post reply on HN