Skip to content

Commit 4c3dc73

Browse files
authored
Merge pull request #950 from tamkylet/readme-writing-changes
readme-writing-structure-and-grammar-changes
2 parents 92a5b0a + 93216d9 commit 4c3dc73

File tree

1 file changed

+16
-14
lines changed

1 file changed

+16
-14
lines changed

README.md

+16-14
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@
66
[![Code Climate](https://img.shields.io/codeclimate/github/reactjs/react-rails.svg?style=flat-square)](https://codeclimate.com/github/reactjs/react-rails)
77

88

9-
React-Rails is a flexible tool to use [React](http://facebook.github.io/react/) with Rails. It:
9+
React-Rails is a flexible tool to use [React](http://facebook.github.io/react/) with Rails. The benefits:
1010
* Automatically renders React server-side and client-side
1111
* Supports Webpacker 3.x, 2.x, 1.1+
1212
* Supports Sprockets 4.x, 3.x, 2.x
1313
* Lets you use [JSX](http://facebook.github.io/react/docs/jsx-in-depth.html), [ES6](http://es6-features.org/), [TypeScript](https://www.typescriptlang.org/), [CoffeeScript](http://coffeescript.org/)
1414

15-
Example app code available here: https://github.com/BookOfGreg/react-rails-example-app
15+
A source code example utilizing React-Rails: https://github.com/BookOfGreg/react-rails-example-app
1616

1717
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
1818
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
@@ -46,30 +46,30 @@ Example app code available here: https://github.com/BookOfGreg/react-rails-examp
4646
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
4747

4848

49-
The React-Rails Wiki has lots of additional information about React-Rails including many "how-to" articles and answers to the most frequently asked questions. Please browse the Wiki after finishing this README:
50-
49+
After reading this README file, additional information about React-Rails can be found in the Wiki page:
5150
https://github.com/reactjs/React-Rails/wiki
51+
The Wiki page features a significant amount of additional information about React-Rails which includes instructional articles and answers to the most frequently asked questions.
5252

5353

5454
## Get started with Webpacker
5555

56-
[or Get started with Sprockets](#use-with-asset-pipeline)
56+
[Alternatively, get started with Sprockets](#use-with-asset-pipeline)
5757

58-
[Webpacker](https://github.com/rails/webpacker) integrates modern JS tooling with Rails.
58+
[Webpacker](https://github.com/rails/webpacker) provides modern JS tooling for Rails. Here are the listed steps for integrating Webpacker and Rails-React with Rails:
5959

60-
1) Create a new Rails app:
60+
##### 1) Create a new Rails app:
6161
```
6262
$ rails new my-app
6363
$ cd my-app
6464
```
6565

66-
2) Add `webpacker` and `react-rails` to your gemfile
66+
##### 2) Add `webpacker` and `react-rails` to your gemfile:
6767
```
6868
gem 'webpacker'
6969
gem 'react-rails'
7070
```
7171

72-
3) Now run the installers:
72+
##### 3) Now run the installers:
7373
```
7474
$ bundle install
7575
$ rails webpacker:install # OR (on rails version < 5.0) rake webpacker:install
@@ -82,37 +82,39 @@ This gives you:
8282
- [`ReactRailsUJS`](#ujs) setup in `app/javascript/packs/application.js`
8383
- `app/javascript/packs/server_rendering.js` for [server-side rendering](#server-side-rendering)
8484

85-
4) Link the JavaScript pack in Rails view using `javascript_pack_tag` [helper](https://github.com/rails/webpacker#usage), for example:
85+
##### 4) Link the JavaScript pack in Rails view using `javascript_pack_tag` [helper](https://github.com/rails/webpacker#usage):
8686
```
8787
<!-- application.html.erb in Head tag below turbolinks -->
8888
<%= javascript_pack_tag 'application' %>
8989
```
9090

91-
5) Generate your first component:
91+
##### 5) Generate your first component:
9292
```
9393
$ rails g react:component HelloWorld greeting:string
9494
```
9595

96-
6) You can also generate your component in a subdirectory:
96+
##### 6) You can also generate your component in a subdirectory:
9797
```
9898
$ rails g react:component my_subdirectory/HelloWorld greeting:string
9999
```
100100
Note: Your component is added to `app/javascript/components/` by default.
101101

102102

103-
7) [Render it in a Rails view](#view-helper):
103+
##### 7) [Render it in a Rails view](#view-helper):
104104

105105
```
106106
<!-- erb: paste this in view -->
107107
<%= react_component("HelloWorld", { greeting: "Hello from react-rails." }) %>
108108
```
109109

110-
8) Lets Start the app:
110+
##### 8) Lets Start the app:
111111
```
112112
$ rails s
113113
```
114114
output: greeting: Hello from react-rails", inspect webpage in your browser too see change in tag props.
115115

116+
### Component name
117+
116118
The component name tells `react-rails` where to load the component. For example:
117119

118120
`react_component` call | component `require`

0 commit comments

Comments
 (0)