Skip to content

Commit eabd18d

Browse files
authored
Line breaks in Readme. Remove v3 Q&A now that it's out.
1 parent 4dac775 commit eabd18d

File tree

1 file changed

+26
-87
lines changed

1 file changed

+26
-87
lines changed

README.md

Lines changed: 26 additions & 87 deletions
Original file line numberDiff line numberDiff line change
@@ -45,108 +45,65 @@ Please read [our docs here](https://react-router.now.sh/).
4545

4646
**tl;dr** Declarative Composability.
4747

48-
We've never been this excited about React Router. Like you, we've
49-
learned a lot about React since we first picked it up. We built a Router
50-
the best we knew how along the way. What we've learned most is that we
51-
love React because of its **declarative composability**.
48+
We've never been this excited about React Router. Like you, we've learned a lot about React since we first picked it up. We built a Router the best we knew how along the way. What we've learned most is that we love React because of its **declarative composability**.
5249

53-
As we looked at the router, it didn't work that way because of the
54-
static route configuration. You couldn't even wrap a Route!
50+
As we looked at the router, it didn't work that way because of the static route configuration. You couldn't even wrap a Route!
5551

5652
```js
5753
// NOPE!
5854
const CoolRoute = (props) => <Route {...props} cool={true}/>
5955
```
6056

61-
For apps to participate in rendering of route components, we had to
62-
create APIs we were never actually comfortable with, like `<Router
63-
createElement render>` and `createRouterMiddleware`. We took
64-
`createElement` away from you and had to give it back!
57+
For apps to participate in rendering of route components, we had to create APIs we were never actually comfortable with, like `<Router createElement render>` and `createRouterMiddleware`. We took `createElement` away from you and had to give it back!
6558

66-
We had to recreate the lifecycle hooks with `onEnter`, `onLeave`, and
67-
`onChange`. React already has `componentWillMount`,
59+
We had to recreate the lifecycle hooks with `onEnter`, `onLeave`, and `onChange`. React already has `componentWillMount`,
6860
`componentWillReceiveProps` and `componentWillUnmount`.
6961

70-
Route configs described your view hierarchy. Turns out, React components
71-
already describe view hierarchy.
62+
Route configs described your view hierarchy. Turns out, React components already describe view hierarchy.
7263

73-
To code-split, we had to introduce `getComponent` and `getChildRoutes`.
74-
Hot module replacement libs had to do specific hacks for routes to work.
75-
The list goes on and on.
64+
To code-split, we had to introduce `getComponent` and `getChildRoutes`. Hot module replacement libs had to do specific hacks for routes to work. The list goes on and on.
7665

77-
React Router was not a React router, it was a routing framework for
78-
React. An accidental framework with APIs that were not only redundant
79-
with React, but incredibly difficult to build an ecosystem around.
66+
React Router was not a React router, it was a routing framework for React. An accidental framework with APIs that were not only redundant with React, but incredibly difficult to build an ecosystem around.
8067

81-
What did we do? We took everything we've learned and love about React
82-
(and we're still learning!) and applied it to routing. It started with
83-
the quest to actually render a `<Route>` (we used to just strip their
84-
props). It ended with removing the idea of routes completely (surprised
85-
us too) and a completely component based API, which actually means no
86-
API at all.
68+
What did we do? We took everything we've learned and love about React (and we're still learning!) and applied it to routing. It started with the quest to actually render a `<Route>` (we used to just strip their props). It ended with removing the idea of routes completely (surprised us too) and a completely component based API, which actually means no API at all.
8769

88-
You control routing by rendering components and passing props. Finally,
89-
we have a solid base for us and others to build an ecosystem on top of.
70+
You control routing by rendering components and passing props. Finally, we have a solid base for us and others to build an ecosystem on top of.
9071

9172
In other words, it's Just React™ and you're going to love it.
9273

9374
### How long until another huge API overhaul?
9475

95-
We know things have been rocky for a lot of people regarding the router
96-
API, to the point that the router has a reputation for huge API
97-
overhauls.
76+
We know things have been rocky for a lot of people regarding the router API, to the point that the router has a reputation for huge API overhauls.
9877

99-
We went back and audited the changes to the major versions. From 0.13
100-
to 1.0 there were huge, backwards incompatible, changes. From 1.0 to 2.0
101-
there were some subtle, but fully backwards compatible changes, and 3.0
102-
will be 2.0 but without any deprecation warnings.
78+
We went back and audited the changes to the major versions. From 0.13 to 1.0 there were huge, backwards incompatible, changes. From 1.0 to 2.0 there were some subtle, but fully backwards compatible changes, and 3.0 will be 2.0 but without any deprecation warnings.
10379

104-
It has been 18 months since the release of 1.0. So, if you've kept
105-
up with only the non-beta releases, you've only had to update your code
106-
once in a year and a half.
80+
It has been 18 months since the release of 1.0. So, if you've kept up with only the non-beta releases, you've only had to update your code once in a year and a half.
10781

108-
Our previous API was fighting against React. With v4, our only API is
109-
components that receive props, so, it's hard to imagine a big change
110-
again. Now that we're embracing (not fighting) React's declarative
111-
composability, we think this API will last as long as React itself,
112-
because that's all it is.
82+
Our previous API was fighting against React. With v4, our only API is components that receive props, so, it's hard to imagine a big change again. Now that we're embracing (not fighting) React's declarative composability, we think this API will last as long as React itself, because that's all it is.
11383

114-
We're excited to create and encourage building an ecosystem of addons to
115-
this stable base. In the words of Cheng Lou, we've become more powerful
116-
(https://www.youtube.com/watch?v=mVVNJKv9esE).
84+
We're excited to create and encourage building an ecosystem of addons to this stable base. In the words of Cheng Lou, we've become more powerful (https://www.youtube.com/watch?v=mVVNJKv9esE).
11785

11886
### Why did you get rid of feature [x]?
11987

120-
We've been pulled a lot of directions with bleeding edge use-cases that
121-
nobody really has generic answers for: server rendering, code-splitting
122-
while avoiding waterfalls, anticipating streamed server rendering, loading
123-
data before rendering anything, etc. We unconsciously tried to solve this
124-
stuff when all we really want to be doing is keeping rendered UI in sync
88+
We've been pulled a lot of directions with bleeding edge use-cases that nobody really has generic answers for: server rendering, code-splitting while avoiding waterfalls, anticipating streamed server rendering, loading data before rendering anything, etc. We unconsciously tried to solve this stuff when all we really want to be doing is keeping rendered UI in sync
12589
with the url. That's our scope of responsibility.
12690

127-
By using components as our only API, features we had that are important
128-
to you can be implemented on top of these components.
91+
By using components as our only API, features we had that are important to you can be implemented on top of these components.
12992

13093
We will be creating some addons and hope to see others too.
13194

13295
### What about scrolling?
13396

134-
We have some code close to being published that will manage the scroll
135-
positions of window and individual elements.
97+
We have some code close to being published that will manage the scroll positions of window and individual elements.
13698

13799
### What about Redux?
138100

139101
We have [a `<ControlledRouter>` component](https://github.com/ReactTraining/react-router-addons-controlled) that makes redux
140-
integration with React Router the same as ... uh ... integrating an
141-
`<input>` with Redux.
102+
integration with React Router the same as ... uh ... integrating an `<input>` with Redux.
142103

143104
### What about route transition hooks? (example needed)
144105

145-
Because we are just components, you have the component lifecycle as
146-
transition hooks. They are completely parallel. The only difference is
147-
that the route transition hooks could be asynchronous. The problem with
148-
that was you weren't in the render lifecycle so you couldn't use React
149-
to indicate to the user something was happening.
106+
Because we are just components, you have the component lifecycle as transition hooks. They are completely parallel. The only difference is that the route transition hooks could be asynchronous. The problem with that was you weren't in the render lifecycle so you couldn't use React to indicate to the user something was happening.
150107

151108
```js
152109
<Route onEnter={(_, cb) => {
@@ -157,10 +114,7 @@ to indicate to the user something was happening.
157114
}}/>
158115
```
159116

160-
One use case was loading data and waiting to render the next screen
161-
until the data landed. With a component, you can save the previous
162-
children, render them while loading, and then render your new children
163-
when you're done. We'll have an example of this eventually.
117+
One use case was loading data and waiting to render the next screen until the data landed. With a component, you can save the previous children, render them while loading, and then render your new children when you're done. We'll have an example of this eventually.
164118

165119
### I liked seeing all my routes in one place, now what?
166120

@@ -172,38 +126,23 @@ See below
172126

173127
### The route config is important to the ecosystem, now what?
174128

175-
We have started an addon that we hope people who are interested in this
176-
will take ownership of here: https://github.com/ReactTraining/react-router-addons-routes
129+
We have started an addon that we hope people who are interested in this will take ownership of here: https://github.com/ReactTraining/react-router-addons-routes
177130

178131
### What about upgrading?
179132

180-
We believe very strongly in iterative migration, not rewrites, for
181-
applications. We are working on a migration guide, but the basic
182-
strategy is that both versions will be runnable in tandem (due to npm
183-
limitations, we'll publish the previous version separately so both can
184-
be installed).
133+
We believe very strongly in iterative migration, not rewrites, for applications. We are working on a migration guide, but the basic strategy is that both versions will be runnable in tandem (due to npm limitations, we'll publish the previous version separately so both can be installed).
185134

186-
You will be able to take routes one-by-one and migrate them to the new
187-
API. Additionally, the config addon mentioned above may help out here.
188-
189-
### What the heck happened to v3?
190-
191-
It's in beta, will be released shortly. It's basically just v2 but w/o
192-
any warnings of deprecated 1.0 API.
135+
You will be able to take routes one-by-one and migrate them to the new API. Additionally, the config addon mentioned above may help out here.
193136

194137
### Do I have to upgrade?
195138

196-
No. Leave your package.json at v2/3 and move on with your life. We'll
197-
be merging bug fixes for v2/3 indefinitely.
139+
No. Leave your package.json at v2/3 and move on with your life. We'll be merging bug fixes for v2/3 indefinitely.
198140

199141
### We're Pumped!
200142

201-
We've received a ton of great feedback from people we really admire in
202-
the React community so we know we've found something special that's a
203-
bit unprecendented in the world of UI routing.
143+
We've received a ton of great feedback from people we really admire in the React community so we know we've found something special that's a bit unprecendented in the world of UI routing.
204144

205-
We've never been more excited about React Router. It's no longer a
206-
router for React, it is truly a React Router.
145+
We've never been more excited about React Router. It's no longer a router for React, it is truly a React Router.
207146

208147
### Where are the examples?!?
209148

0 commit comments

Comments
 (0)