Skip to content

Commit 39cc583

Browse files
author
Robert Mosolgo
committed
Merge pull request #237 from christopherstyles/cs-small-proofreading-edits
Fix a documentation typo and several small proofing edits
2 parents 8d82588 + 01e1711 commit 39cc583

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
- Provide [various `react` builds](#reactjs-builds) to your asset bundle
1414
- Transform [`.jsx` in the asset pipeline](#jsx)
1515
- [Render components into views and mount them](#rendering--mounting) via view helper & `react_ujs`
16-
- [Render components server-side](#server-rendering) with `prerender: true`.
16+
- [Render components server-side](#server-rendering) with `prerender: true`
1717
- [Generate components](#component-generator) with a Rails generator
1818

1919
## Installation
@@ -24,7 +24,7 @@ Add `react-rails` to your gemfile:
2424
gem 'react-rails', '~> 1.0'
2525
```
2626

27-
Next, run the installation script.
27+
Next, run the installation script:
2828

2929
```bash
3030
rails g react:install
@@ -93,7 +93,7 @@ Component = React.createClass
9393

9494
### Rendering & mounting
9595

96-
`react-rails` includes a view helper (`react_component`) and an unobtrusive JavaScript driver (`react_ujs`) which work together to put React components on the page. You should require the UJS driver in your manifest after `react` (and after `turbolinks` if you use [Turbolinks](https://github.com/rails/turbolinks))
96+
`react-rails` includes a view helper (`react_component`) and an unobtrusive JavaScript driver (`react_ujs`) which work together to put React components on the page. You should require the UJS driver in your manifest after `react` (and after `turbolinks` if you use [Turbolinks](https://github.com/rails/turbolinks)).
9797

9898
The __view helper__ puts a `div` on the page with the requested component class & props. For example:
9999

@@ -107,14 +107,14 @@ On page load, the __`react_ujs` driver__ will scan the page and mount components
107107

108108
`react_ujs` uses Turbolinks events if they're available, otherwise, it uses native events. __Turbolinks >= 2.4.0__ is recommended because it exposes better events.
109109

110-
The view helper's signature is
110+
The view helper's signature is:
111111

112112
```ruby
113113
react_component(component_class_name, props={}, html_options={})
114114
```
115115

116116
- `component_class_name` is a string which names a globally-accessible component class. It may have dots (eg, `"MyApp.Header.MenuItem"`).
117-
- `props` is either an object that responds to `#to_json` or an already-stringified JSON object (eg, made with Jbuilder, see note below)
117+
- `props` is either an object that responds to `#to_json` or an already-stringified JSON object (eg, made with Jbuilder, see note below).
118118
- `html_options` may include:
119119
- `tag:` to use an element other than a `div` to embed `data-react-class` and `-props`.
120120
- `prerender: true` to render the component on the server.
@@ -137,7 +137,7 @@ _(It will be also be mounted by the UJS on page load.)_
137137

138138
There are some requirements for this to work:
139139

140-
- `react-rails` must load your code. By convention, it uses `components.js`, which was created by the install task. This file must include your components _and_ their dependencies (eg, Underscore.js).
140+
- `react-rails` must load your code. By convention it uses `components.js`, which was created by the install task. This file must include your components _and_ their dependencies (eg, Underscore.js).
141141
- Your components must be accessible in the global scope. If you are using `.js.jsx.coffee` files then the wrapper function needs to be taken into account:
142142

143143
```coffee
@@ -171,7 +171,7 @@ end
171171

172172
### Component generator
173173

174-
react-rails ships with a Rails generator to help you get started with a simple component scaffold. You can run it using `rails generate react:component ComponentName`. The generator takes an optional list of arguments for default propTypes, which follow the conventions set in the [Reusable Components](http://facebook.github.io/react/docs/reusable-components.html) section of the React documentation.
174+
`react-rails` ships with a Rails generator to help you get started with a simple component scaffold. You can run it using `rails generate react:component ComponentName`. The generator takes an optional list of arguments for default propTypes, which follow the conventions set in the [Reusable Components](http://facebook.github.io/react/docs/reusable-components.html) section of the React documentation.
175175

176176
For example:
177177

@@ -218,9 +218,9 @@ The generator can use the following arguments to create basic propTypes:
218218

219219
The following additional arguments have special behavior:
220220

221-
* `instanceOf` takes an optional class name in the form of {className}
221+
* `instanceOf` takes an optional class name in the form of {className}.
222222
* `oneOf` behaves like an enum, and takes an optional list of strings in the form of `'name:oneOf{one,two,three}'`.
223-
* `oneOfType` takes an optional list of react and custom types in the form of `'model:oneOfType{string,number,OtherType}'`
223+
* `oneOfType` takes an optional list of react and custom types in the form of `'model:oneOfType{string,number,OtherType}'`.
224224

225225
Note that the arguments for `oneOf` and `oneOfType` must be enclosed in single quotes to prevent your terminal from expanding them into an argument list.
226226

VERSIONS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
There are three ways to control what version of React.js (and JSXTransformer) is used by `react-rails`:
44

55
- Use the [bundled version](#bundled-versions) that comes with the gem
6-
- Specify a [react-source verison](#react-source-version)
6+
- Specify a [react-source version](#react-source-version)
77
- [Drop in a copy](#drop-in-version) of React.js
88

99
## Bundled Versions

0 commit comments

Comments
 (0)