Skip to content

Commit 723c06c

Browse files
More updates.
1 parent 61d6cd4 commit 723c06c

1 file changed

Lines changed: 14 additions & 7 deletions

File tree

pages/tutorials/React.md

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,19 @@
11
This quick start guide will teach you how to wire up TypeScript with [React](http://facebook.github.io/react/).
22
By the end, you'll have
33

4+
* a project with React and TypeScript
45
* linting with [TSLint](https://github.com/palantir/tslint)
5-
* testing with [Jest](https://facebook.github.io/jest/), and
6+
* testing with [Jest](https://facebook.github.io/jest/) and [Enzyme](http://airbnb.io/enzyme/), and
67
* state management with [Redux](https://github.com/reactjs/react-redux)
78

8-
We'll use the [create-react-app](https://github.com/facebookincubator/create-react-app) tool to quickly get set up, and then eject to see how these tools are all put together.
9+
We'll use the [create-react-app](https://github.com/facebookincubator/create-react-app) tool to quickly get set up.
910

1011
We assume that you're already using [Node.js](https://nodejs.org/) with [npm](https://www.npmjs.com/).
12+
You may also want to get a sense of [the basics with React](https://facebook.github.io/react/docs/hello-world.html).
1113

1214
# Install create-react-app
1315

14-
We're going to use the create-react-app because it sets some canonical defaults for React projects.
16+
We're going to use the create-react-app because it sets some useful tools and canonical defaults for React projects.
1517
This is just a command-line utility to scaffold out new React projects.
1618

1719
```shell
@@ -44,7 +46,7 @@ my-app/
4446

4547
Of note:
4648

47-
* `tsconfig.json` contains some TypeScript-specific options for our project.
49+
* `tsconfig.json` contains TypeScript-specific options for our project.
4850
* `tslint.json` stores the settings that our linter, [TSLint](https://github.com/palantir/tslint), will use.
4951
* `package.json` contains our dependencies, as well as some shortcuts for commands we'd like to run for testing, previewing, and deploying our app.
5052
* `public` contains static assets like the HTML page we're planning to deploy to, or images. You can delete any file in this folder apart from `index.html`.
@@ -208,7 +210,8 @@ To style our `Hello` component, we can create a CSS file at `src/components/Hell
208210
}
209211
```
210212

211-
The tools that create-react-app uses (namely, Webpack and various loaders) allow us to import the stylesheets we're interested in.
213+
The tools that create-react-app uses (namely, Webpack and various loaders) allow us to just import the stylesheets we're interested in.
214+
When our build runs, any imported `.css` files will be concatenated into an output file.
212215
So in `src/components/Hello.tsx`, we'll add the following import.
213216

214217
```ts
@@ -295,7 +298,7 @@ On its own, React is a useful library for creating composable views.
295298
However, React doesn't come with any facility for synchronizing data between your application.
296299
As far as a React component is concerned, data flows down through its children through the props you specify on each element.
297300

298-
As an answer, the React community relies on libraries like Redux and MobX.
301+
Because React on its own does not provide a built-in support for state management, the React community uses libraries like Redux and MobX.
299302

300303
[Redux](http://redux.js.org) relies on synchronizing data through a centralized and immutable store of data, and updates to that data will trigger a re-render our application.
301304
State is updated in an immutable fashion by sending explicit action messages which must be handled by functions called reducers.
@@ -305,10 +308,13 @@ Because of the explicit nature, it is often be easier to reason about how an act
305308
Keeping state fully synchronized for any observers is done by simply marking state as observable.
306309
As a nice bonus, the library is already written in TypeScript.
307310

308-
There are various merits and have tradeoffs to both.
311+
There are various merits and tradeoffs to both.
309312
Generally Redux tends to see more widespread usage, so for the purposes of this tutorial, we'll focus on adding Redux;
310313
however, you should feel encouraged to explore both.
311314

315+
The following section may have a steep learning curve.
316+
We strongly suggest you [familiarize yourself with Redux through its documentation](http://redux.js.org/).
317+
312318
## Setting the stage for actions
313319

314320
It doesn't make sense to add Redux unless the state of our application changes.
@@ -615,6 +621,7 @@ npm run eject
615621
and you should be good to go!
616622

617623
As a heads up, you may want to commit all your work before running an eject.
624+
You cannot undo an eject command, so opting out is permanent without committing.
618625

619626
# Next steps
620627

0 commit comments

Comments
 (0)