Live data from Hacker News

React Router: Declarative Routing for React

reacttraining.com

51–60 of 68 posts

Re: React Router: Declarative Routing for React

#51
post #25

Earlier quoted context omitted.

From my perspective, React Navigation primarily differs from React Router in a few ways: 1) In RR, nav state is the URI. Because mobile nav state is complex, React Navigation treats URIs as actions to modify a more complex navigation state 2) RR uses React Components for navigation logic. In React Navigation, the isolated nav logic is statically available, (without rendering). 3) React Navigation is composable, so na…

1) Not sure why navigating is "more complex on native". The platform the code runs on has nothing to do with the way the user interacts with the page. Complex navigation state is represented as one or many stacks of URIs. 2) In React Router you can have a statically available route config. This is React. Make an array then map it to render. 3) React Router is all components, so it composes exactly like the rest of yo…

Navigating isn't more complex in native apps, and I didn't mean to imply that. But navigation state may be deeper than flat sets of URIs: it may be a tree.

For example: your app may have a stack of modal screens, and each of those screens may have tabs or a stack, and there may be another tab or stack navigation within each of those. In React Navigation, each node can be a router that manages its own navigation state.

Re: React Router: Declarative Routing for React

#52
post #21

The new API looks quite a bit like the API we've been running in React-Router-Component since 2014 ( https://github.com/STRML/react-router-component ). Of course, RRC is not as battle-tested as React-Router; it's more of a "works for us" project I took over from @andreypopp as we had already committed to the router before React-Router became stable. And given the many backcompat-breaking changes to React-Router, it s…

> backcompat-breaking changes to React-Router We had breaking changes from 0.13 to 1.0. Then complete BC from 1.0 to 2.0 That's two years, one breaking upgrade. Don't confuse a libs "changing API" with "people use the development branch as stable".

Always felt kind of scummy that the same guys maintaining this library - complete with frequent breaking changes - are selling training around React for 1.8k a pop.

In other industries, we call this a "conflict of interest". "Same guys writing the building code for 2017 (featuring many changes from the 2015 code) are selling in-person workshops on the 2017 building code!" Take it out of the context of software and it immediately feels dirty.

Re: React Router: Declarative Routing for React

#53

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.

You should remove your header of "up-to-date" on your marketing page until you get that fix in place.

Re: React Router: Declarative Routing for React

#54

Earlier quoted context omitted.

> backcompat-breaking changes to React-Router We had breaking changes from 0.13 to 1.0. Then complete BC from 1.0 to 2.0 That's two years, one breaking upgrade. Don't confuse a libs "changing API" with "people use the development branch as stable".

Always felt kind of scummy that the same guys maintaining this library - complete with frequent breaking changes - are selling training around React for 1.8k a pop. In other industries, we call this a "conflict of interest". "Same guys writing the building code for 2017 (featuring many changes from the 2015 code) are selling in-person workshops on the 2017 building code!" Take it out of the context of software and it…

I'm sorry I fail to understand how this is different than tutoring, say, a coach who's developed a training program selling DVDs and also getting paid for personal training on his own program.

This happens all the time, in many industries, where's the dirt?

Anyway, I'll take this chance to thank Ryan and Michael and Tim and Jimmy and others I forget for their hard work.

Re: React Router: Declarative Routing for React

#55
post #54

Earlier quoted context omitted.

Always felt kind of scummy that the same guys maintaining this library - complete with frequent breaking changes - are selling training around React for 1.8k a pop. In other industries, we call this a "conflict of interest". "Same guys writing the building code for 2017 (featuring many changes from the 2015 code) are selling in-person workshops on the 2017 building code!" Take it out of the context of software and it…

I'm sorry I fail to understand how this is different than tutoring, say, a coach who's developed a training program selling DVDs and also getting paid for personal training on his own program. This happens all the time, in many industries, where's the dirt? Anyway, I'll take this chance to thank Ryan and Michael and Tim and Jimmy and others I forget for their hard work.

False analogy - RR is a de-facto standard in the web development community, hence my comparison to a building code.

Re: React Router: Declarative Routing for React

#56

Earlier quoted context omitted.

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 nei…

Sorry, your question was clear, I don't use search parameters in my app and got confused, I just check it and it's actually `location.search` that return a string `?genre=mystery'. The props passed to the component by `route` are not yet documented, this is what I gathered:

  "path": "/:genre",
  "computedMatch": 
    "path": "/:genre",
    "url": "/foo",
    "isExact": true,
    "params": 
      "genre": "foo"
  "length": 7,
  "action": "POP",
  "location":
    "pathname": "/foo",
    "search": "?genre=mystery",
    "hash": ""
  "match": 
    "path": "/:genre",
    "url": "/foo",
    "isExact": true,
    "params": 
      "genre": "foo"

Re: React Router: Declarative Routing for React

#57
post #54

Earlier quoted context omitted.

I'm sorry I fail to understand how this is different than tutoring, say, a coach who's developed a training program selling DVDs and also getting paid for personal training on his own program. This happens all the time, in many industries, where's the dirt? Anyway, I'll take this chance to thank Ryan and Michael and Tim and Jimmy and others I forget for their hard work.

False analogy - RR is a de-facto standard in the web development community, hence my comparison to a building code.

No, RR is the de facto standard for the React community. And they're not doing training just on RR.

Claiming that because they made the most popular routing library for React it's shady to provide tutoring about it for profit is very much of a stretch in my book. Care to explain where exactly is the conflict of interest? Does that mean it's also shady to work as consultants? Where is the line drawn?

Do you really believe that noone is going to call them out if they started doing things deliberately to maximize profit (i.e. breaking changes without actual improvement, harder to understand than necessary APIs, etc)?

Re: React Router: Declarative Routing for React

#58
post #23

Earlier quoted context omitted.

react-navigation will supersede all existing navigator solutions in React Native core (Navigator/NavigationExperimental). React Router v4 is building a react-native integration to show that it is capable of working on Native. It's centered around URLs so it's attempting to make Deep Linking into your application easier, as well potentially re-using the same navigation on the web. That being said react-navigation can…

Out of curiosity, why was the decision made to build a completely new router (react-navigation) vs collaborating on better native support to the existing react-router? (which is working towards that anyway)

Difference in opinions about what could be accomplished via react-router vs what native paradigms needed to be crafted.

Re: React Router: Declarative Routing for React

#59

Earlier quoted context omitted.

> backcompat-breaking changes to React-Router We had breaking changes from 0.13 to 1.0. Then complete BC from 1.0 to 2.0 That's two years, one breaking upgrade. Don't confuse a libs "changing API" with "people use the development branch as stable".

Always felt kind of scummy that the same guys maintaining this library - complete with frequent breaking changes - are selling training around React for 1.8k a pop. In other industries, we call this a "conflict of interest". "Same guys writing the building code for 2017 (featuring many changes from the 2015 code) are selling in-person workshops on the 2017 building code!" Take it out of the context of software and it…

We had breaking changes from 0.13 -> 1.0. We had no breaking changes from 1.0 -> 2.0. That's 2 years with no breaking changes.

Our workshops have $899 early bird tickets.

Every software company I've ever worked for sells training and consulting for their software.

Re: React Router: Declarative Routing for React

#60

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.

you get location.search, which is just a string. We removed default query handling because it can be composed in with something like `RouteWithQuery` and `LinkWithQuery`. Lots of people didn't want the default serialization anyway. It's like 7 lines, we'll have an example of it you can copy/paste.
Post reply on HN