react_on_rails 2.0.0.rc.1 → 2.0.0.rc.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.eslintrc +1 -1
- data/.rubocop.yml +1 -1
- data/.travis.yml +1 -2
- data/CHANGELOG.md +46 -0
- data/Gemfile +0 -7
- data/README.md +16 -2
- data/Rakefile +1 -1
- data/docs/additional_reading/manual_installation.md +3 -4
- data/lib/generators/react_on_rails/base_generator.rb +12 -6
- data/lib/generators/react_on_rails/bootstrap_generator.rb +5 -4
- data/lib/generators/react_on_rails/dev_tests_generator.rb +20 -2
- data/lib/generators/react_on_rails/generator_helper.rb +8 -5
- data/lib/generators/react_on_rails/generator_messages.rb +39 -0
- data/lib/generators/react_on_rails/heroku_deployment_generator.rb +3 -3
- data/lib/generators/react_on_rails/install_generator.rb +34 -14
- data/lib/generators/react_on_rails/js_linters_generator.rb +1 -1
- data/lib/generators/react_on_rails/react_no_redux_generator.rb +5 -7
- data/lib/generators/react_on_rails/react_with_redux_generator.rb +1 -2
- data/lib/generators/react_on_rails/ruby_linters_generator.rb +5 -3
- data/lib/generators/react_on_rails/templates/base/base/Procfile.dev-hot.tt +4 -0
- data/lib/generators/react_on_rails/templates/base/base/Procfile.dev.tt +0 -1
- data/lib/generators/react_on_rails/templates/base/base/client/app/bundles/HelloWorld/components/HelloWorldWidget.jsx.tt +66 -0
- data/lib/generators/react_on_rails/templates/base/base/client/package.json.tt +3 -2
- data/lib/generators/react_on_rails/templates/base/base/client/server.js +2 -2
- data/lib/generators/react_on_rails/templates/base/base/client/{webpack.client.base.config.js.tt → webpack.client.base.config.js} +4 -2
- data/lib/generators/react_on_rails/templates/base/base/client/webpack.client.hot.config.js.tt +6 -6
- data/lib/generators/react_on_rails/templates/base/base/client/webpack.client.rails.config.js +3 -3
- data/lib/generators/react_on_rails/templates/base/base/package.json +4 -1
- data/lib/generators/react_on_rails/templates/base/server_rendering/client/webpack.server.rails.config.js +3 -3
- data/lib/generators/react_on_rails/templates/bootstrap/client/assets/stylesheets/_post-bootstrap.scss +1 -1
- data/lib/generators/react_on_rails/templates/js_linters/client/.eslintrc +1 -1
- data/lib/generators/react_on_rails/templates/no_redux/base/client/app/bundles/HelloWorld/containers/HelloWorld.jsx +9 -7
- data/lib/generators/react_on_rails/templates/redux/base/client/app/bundles/HelloWorld/containers/HelloWorld.jsx +6 -1
- data/lib/generators/react_on_rails/templates/redux/base/client/app/bundles/HelloWorld/reducers/helloWorldReducer.jsx +4 -4
- data/lib/generators/react_on_rails/templates/ruby_linters/{ruby-lint.yml → ruby-lint.yml.tt} +6 -0
- data/lib/react_on_rails/version.rb +1 -1
- data/package.json +5 -3
- data/rakelib/example_type.rb +1 -1
- data/rakelib/lint.rake +4 -3
- data/react_on_rails.gemspec +12 -2
- data/ruby-lint.yml +1 -0
- metadata +153 -12
- data/lib/generators/react_on_rails/templates/no_redux/base/client/app/bundles/HelloWorld/components/HelloWorldWidget.jsx +0 -39
- data/lib/generators/react_on_rails/templates/redux/base/client/app/bundles/HelloWorld/components/HelloWorldWidget.jsx +0 -50
data/rakelib/example_type.rb
CHANGED
@@ -145,7 +145,7 @@ module ReactOnRails
|
|
145
145
|
# Assumes we are inside a rails app's folder and necessary gems have been installed
|
146
146
|
def generator_shell_commands
|
147
147
|
shell_commands = []
|
148
|
-
shell_commands << "rails generate react_on_rails:install #{generator_options}"
|
148
|
+
shell_commands << "rails generate react_on_rails:install #{generator_options} --ignore-warnings"
|
149
149
|
shell_commands << "rails generate react_on_rails:dev_tests #{generator_options}"
|
150
150
|
end
|
151
151
|
|
data/rakelib/lint.rake
CHANGED
@@ -9,7 +9,8 @@ namespace :lint do
|
|
9
9
|
|
10
10
|
desc "Run ruby-lint as shell"
|
11
11
|
task :ruby do
|
12
|
-
|
12
|
+
puts "See /ruby-lint.yml for what directories are included."
|
13
|
+
sh_in_dir(gem_root, "ruby-lint .")
|
13
14
|
end
|
14
15
|
|
15
16
|
desc "Run scss-lint as shell"
|
@@ -19,12 +20,12 @@ namespace :lint do
|
|
19
20
|
|
20
21
|
desc "Run eslint as shell"
|
21
22
|
task :eslint do
|
22
|
-
sh_in_dir(gem_root, "eslint . --ext .jsx and .js")
|
23
|
+
sh_in_dir(gem_root, "$(npm bin)/eslint . --ext .jsx and .js")
|
23
24
|
end
|
24
25
|
|
25
26
|
desc "Run jscs from shell"
|
26
27
|
task :jscs do
|
27
|
-
sh_in_dir(gem_root, "jscs -e -v .")
|
28
|
+
sh_in_dir(gem_root, "$(npm bin)/jscs -e -v .")
|
28
29
|
end
|
29
30
|
|
30
31
|
desc "Run all eslint, jscs, rubocop linters. Skip ruby-lint and scss"
|
data/react_on_rails.gemspec
CHANGED
@@ -19,13 +19,23 @@ Gem::Specification.new do |s|
|
|
19
19
|
s.executables = s.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
20
20
|
s.require_paths = ["lib"]
|
21
21
|
|
22
|
-
s.add_dependency "rails", ">= 3.2"
|
23
|
-
s.add_dependency "execjs", "~> 2.5"
|
24
22
|
s.add_dependency "connection_pool"
|
23
|
+
s.add_dependency "execjs", "~> 2.5"
|
24
|
+
s.add_dependency "rainbow", "~> 2.0"
|
25
|
+
s.add_dependency "rails", ">= 3.2"
|
25
26
|
|
26
27
|
s.add_development_dependency "bundler", "~> 1.10"
|
27
28
|
s.add_development_dependency "rake", "~> 10.0"
|
28
29
|
s.add_development_dependency "rspec"
|
29
30
|
s.add_development_dependency "coveralls"
|
30
31
|
s.add_development_dependency "generator_spec"
|
32
|
+
s.add_development_dependency "pry"
|
33
|
+
s.add_development_dependency "pry-byebug"
|
34
|
+
s.add_development_dependency "pry-stack_explorer"
|
35
|
+
s.add_development_dependency "pry-doc"
|
36
|
+
s.add_development_dependency "pry-state"
|
37
|
+
s.add_development_dependency "pry-toys"
|
38
|
+
s.add_development_dependency "pry-rescue"
|
39
|
+
s.add_development_dependency "binding_of_caller"
|
40
|
+
s.add_development_dependency "awesome_print"
|
31
41
|
end
|
data/ruby-lint.yml
CHANGED
metadata
CHANGED
@@ -1,29 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: react_on_rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.0.rc.
|
4
|
+
version: 2.0.0.rc.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Justin Gordon
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-01-
|
11
|
+
date: 2016-01-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name:
|
14
|
+
name: connection_pool
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '0'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
26
|
+
version: '0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: execjs
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -39,19 +39,33 @@ dependencies:
|
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '2.5'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
|
-
name:
|
42
|
+
name: rainbow
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '2.0'
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '2.0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rails
|
43
57
|
requirement: !ruby/object:Gem::Requirement
|
44
58
|
requirements:
|
45
59
|
- - ">="
|
46
60
|
- !ruby/object:Gem::Version
|
47
|
-
version: '
|
61
|
+
version: '3.2'
|
48
62
|
type: :runtime
|
49
63
|
prerelease: false
|
50
64
|
version_requirements: !ruby/object:Gem::Requirement
|
51
65
|
requirements:
|
52
66
|
- - ">="
|
53
67
|
- !ruby/object:Gem::Version
|
54
|
-
version: '
|
68
|
+
version: '3.2'
|
55
69
|
- !ruby/object:Gem::Dependency
|
56
70
|
name: bundler
|
57
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -122,6 +136,132 @@ dependencies:
|
|
122
136
|
- - ">="
|
123
137
|
- !ruby/object:Gem::Version
|
124
138
|
version: '0'
|
139
|
+
- !ruby/object:Gem::Dependency
|
140
|
+
name: pry
|
141
|
+
requirement: !ruby/object:Gem::Requirement
|
142
|
+
requirements:
|
143
|
+
- - ">="
|
144
|
+
- !ruby/object:Gem::Version
|
145
|
+
version: '0'
|
146
|
+
type: :development
|
147
|
+
prerelease: false
|
148
|
+
version_requirements: !ruby/object:Gem::Requirement
|
149
|
+
requirements:
|
150
|
+
- - ">="
|
151
|
+
- !ruby/object:Gem::Version
|
152
|
+
version: '0'
|
153
|
+
- !ruby/object:Gem::Dependency
|
154
|
+
name: pry-byebug
|
155
|
+
requirement: !ruby/object:Gem::Requirement
|
156
|
+
requirements:
|
157
|
+
- - ">="
|
158
|
+
- !ruby/object:Gem::Version
|
159
|
+
version: '0'
|
160
|
+
type: :development
|
161
|
+
prerelease: false
|
162
|
+
version_requirements: !ruby/object:Gem::Requirement
|
163
|
+
requirements:
|
164
|
+
- - ">="
|
165
|
+
- !ruby/object:Gem::Version
|
166
|
+
version: '0'
|
167
|
+
- !ruby/object:Gem::Dependency
|
168
|
+
name: pry-stack_explorer
|
169
|
+
requirement: !ruby/object:Gem::Requirement
|
170
|
+
requirements:
|
171
|
+
- - ">="
|
172
|
+
- !ruby/object:Gem::Version
|
173
|
+
version: '0'
|
174
|
+
type: :development
|
175
|
+
prerelease: false
|
176
|
+
version_requirements: !ruby/object:Gem::Requirement
|
177
|
+
requirements:
|
178
|
+
- - ">="
|
179
|
+
- !ruby/object:Gem::Version
|
180
|
+
version: '0'
|
181
|
+
- !ruby/object:Gem::Dependency
|
182
|
+
name: pry-doc
|
183
|
+
requirement: !ruby/object:Gem::Requirement
|
184
|
+
requirements:
|
185
|
+
- - ">="
|
186
|
+
- !ruby/object:Gem::Version
|
187
|
+
version: '0'
|
188
|
+
type: :development
|
189
|
+
prerelease: false
|
190
|
+
version_requirements: !ruby/object:Gem::Requirement
|
191
|
+
requirements:
|
192
|
+
- - ">="
|
193
|
+
- !ruby/object:Gem::Version
|
194
|
+
version: '0'
|
195
|
+
- !ruby/object:Gem::Dependency
|
196
|
+
name: pry-state
|
197
|
+
requirement: !ruby/object:Gem::Requirement
|
198
|
+
requirements:
|
199
|
+
- - ">="
|
200
|
+
- !ruby/object:Gem::Version
|
201
|
+
version: '0'
|
202
|
+
type: :development
|
203
|
+
prerelease: false
|
204
|
+
version_requirements: !ruby/object:Gem::Requirement
|
205
|
+
requirements:
|
206
|
+
- - ">="
|
207
|
+
- !ruby/object:Gem::Version
|
208
|
+
version: '0'
|
209
|
+
- !ruby/object:Gem::Dependency
|
210
|
+
name: pry-toys
|
211
|
+
requirement: !ruby/object:Gem::Requirement
|
212
|
+
requirements:
|
213
|
+
- - ">="
|
214
|
+
- !ruby/object:Gem::Version
|
215
|
+
version: '0'
|
216
|
+
type: :development
|
217
|
+
prerelease: false
|
218
|
+
version_requirements: !ruby/object:Gem::Requirement
|
219
|
+
requirements:
|
220
|
+
- - ">="
|
221
|
+
- !ruby/object:Gem::Version
|
222
|
+
version: '0'
|
223
|
+
- !ruby/object:Gem::Dependency
|
224
|
+
name: pry-rescue
|
225
|
+
requirement: !ruby/object:Gem::Requirement
|
226
|
+
requirements:
|
227
|
+
- - ">="
|
228
|
+
- !ruby/object:Gem::Version
|
229
|
+
version: '0'
|
230
|
+
type: :development
|
231
|
+
prerelease: false
|
232
|
+
version_requirements: !ruby/object:Gem::Requirement
|
233
|
+
requirements:
|
234
|
+
- - ">="
|
235
|
+
- !ruby/object:Gem::Version
|
236
|
+
version: '0'
|
237
|
+
- !ruby/object:Gem::Dependency
|
238
|
+
name: binding_of_caller
|
239
|
+
requirement: !ruby/object:Gem::Requirement
|
240
|
+
requirements:
|
241
|
+
- - ">="
|
242
|
+
- !ruby/object:Gem::Version
|
243
|
+
version: '0'
|
244
|
+
type: :development
|
245
|
+
prerelease: false
|
246
|
+
version_requirements: !ruby/object:Gem::Requirement
|
247
|
+
requirements:
|
248
|
+
- - ">="
|
249
|
+
- !ruby/object:Gem::Version
|
250
|
+
version: '0'
|
251
|
+
- !ruby/object:Gem::Dependency
|
252
|
+
name: awesome_print
|
253
|
+
requirement: !ruby/object:Gem::Requirement
|
254
|
+
requirements:
|
255
|
+
- - ">="
|
256
|
+
- !ruby/object:Gem::Version
|
257
|
+
version: '0'
|
258
|
+
type: :development
|
259
|
+
prerelease: false
|
260
|
+
version_requirements: !ruby/object:Gem::Requirement
|
261
|
+
requirements:
|
262
|
+
- - ">="
|
263
|
+
- !ruby/object:Gem::Version
|
264
|
+
version: '0'
|
125
265
|
description: See README.md
|
126
266
|
email:
|
127
267
|
- justin@shakacode.com
|
@@ -168,23 +308,26 @@ files:
|
|
168
308
|
- lib/generators/react_on_rails/bootstrap_generator.rb
|
169
309
|
- lib/generators/react_on_rails/dev_tests_generator.rb
|
170
310
|
- lib/generators/react_on_rails/generator_helper.rb
|
311
|
+
- lib/generators/react_on_rails/generator_messages.rb
|
171
312
|
- lib/generators/react_on_rails/heroku_deployment_generator.rb
|
172
313
|
- lib/generators/react_on_rails/install_generator.rb
|
173
314
|
- lib/generators/react_on_rails/js_linters_generator.rb
|
174
315
|
- lib/generators/react_on_rails/react_no_redux_generator.rb
|
175
316
|
- lib/generators/react_on_rails/react_with_redux_generator.rb
|
176
317
|
- lib/generators/react_on_rails/ruby_linters_generator.rb
|
318
|
+
- lib/generators/react_on_rails/templates/base/base/Procfile.dev-hot.tt
|
177
319
|
- lib/generators/react_on_rails/templates/base/base/Procfile.dev.tt
|
178
320
|
- lib/generators/react_on_rails/templates/base/base/REACT_ON_RAILS.md
|
179
321
|
- lib/generators/react_on_rails/templates/base/base/app/controllers/hello_world_controller.rb
|
180
322
|
- lib/generators/react_on_rails/templates/base/base/app/views/hello_world/index.html.erb.tt
|
181
323
|
- lib/generators/react_on_rails/templates/base/base/client/.babelrc
|
182
324
|
- lib/generators/react_on_rails/templates/base/base/client/REACT_ON_RAILS_CLIENT_README.md
|
325
|
+
- lib/generators/react_on_rails/templates/base/base/client/app/bundles/HelloWorld/components/HelloWorldWidget.jsx.tt
|
183
326
|
- lib/generators/react_on_rails/templates/base/base/client/app/bundles/HelloWorld/startup/clientRegistration.jsx.tt
|
184
327
|
- lib/generators/react_on_rails/templates/base/base/client/index.jade
|
185
328
|
- lib/generators/react_on_rails/templates/base/base/client/package.json.tt
|
186
329
|
- lib/generators/react_on_rails/templates/base/base/client/server.js
|
187
|
-
- lib/generators/react_on_rails/templates/base/base/client/webpack.client.base.config.js
|
330
|
+
- lib/generators/react_on_rails/templates/base/base/client/webpack.client.base.config.js
|
188
331
|
- lib/generators/react_on_rails/templates/base/base/client/webpack.client.hot.config.js.tt
|
189
332
|
- lib/generators/react_on_rails/templates/base/base/client/webpack.client.rails.config.js
|
190
333
|
- lib/generators/react_on_rails/templates/base/base/config/initializers/react_on_rails.rb
|
@@ -209,12 +352,10 @@ files:
|
|
209
352
|
- lib/generators/react_on_rails/templates/js_linters/client/.eslintignore
|
210
353
|
- lib/generators/react_on_rails/templates/js_linters/client/.eslintrc
|
211
354
|
- lib/generators/react_on_rails/templates/js_linters/client/.jscsrc
|
212
|
-
- lib/generators/react_on_rails/templates/no_redux/base/client/app/bundles/HelloWorld/components/HelloWorldWidget.jsx
|
213
355
|
- lib/generators/react_on_rails/templates/no_redux/base/client/app/bundles/HelloWorld/containers/HelloWorld.jsx
|
214
356
|
- lib/generators/react_on_rails/templates/no_redux/base/client/app/bundles/HelloWorld/startup/HelloWorldAppClient.jsx.tt
|
215
357
|
- lib/generators/react_on_rails/templates/no_redux/server_rendering/client/app/bundles/HelloWorld/startup/HelloWorldAppServer.jsx
|
216
358
|
- lib/generators/react_on_rails/templates/redux/base/client/app/bundles/HelloWorld/actions/helloWorldActionCreators.jsx
|
217
|
-
- lib/generators/react_on_rails/templates/redux/base/client/app/bundles/HelloWorld/components/HelloWorldWidget.jsx
|
218
359
|
- lib/generators/react_on_rails/templates/redux/base/client/app/bundles/HelloWorld/constants/helloWorldConstants.jsx
|
219
360
|
- lib/generators/react_on_rails/templates/redux/base/client/app/bundles/HelloWorld/containers/HelloWorld.jsx
|
220
361
|
- lib/generators/react_on_rails/templates/redux/base/client/app/bundles/HelloWorld/reducers/helloWorldReducer.jsx
|
@@ -227,7 +368,7 @@ files:
|
|
227
368
|
- lib/generators/react_on_rails/templates/ruby_linters/.scss-lint.yml
|
228
369
|
- lib/generators/react_on_rails/templates/ruby_linters/lib/tasks/brakeman.rake
|
229
370
|
- lib/generators/react_on_rails/templates/ruby_linters/lib/tasks/ci.rake
|
230
|
-
- lib/generators/react_on_rails/templates/ruby_linters/ruby-lint.yml
|
371
|
+
- lib/generators/react_on_rails/templates/ruby_linters/ruby-lint.yml.tt
|
231
372
|
- lib/react_on_rails.rb
|
232
373
|
- lib/react_on_rails/configuration.rb
|
233
374
|
- lib/react_on_rails/engine.rb
|
@@ -1,39 +0,0 @@
|
|
1
|
-
import React, { PropTypes } from 'react';
|
2
|
-
import _ from 'lodash';
|
3
|
-
|
4
|
-
// Simple example of a React "dumb" component
|
5
|
-
export default class HelloWorldWidget extends React.Component {
|
6
|
-
static propTypes = {
|
7
|
-
name: PropTypes.string.isRequired,
|
8
|
-
_updateName: PropTypes.func.isRequired,
|
9
|
-
};
|
10
|
-
|
11
|
-
constructor(props, context) {
|
12
|
-
super(props, context);
|
13
|
-
|
14
|
-
// Uses lodash to bind all methods to the context of the object instance, otherwise
|
15
|
-
// the methods defined here would not refer to the component's class, not the component
|
16
|
-
// instance itself.
|
17
|
-
_.bindAll(this, '_handleChange');
|
18
|
-
}
|
19
|
-
|
20
|
-
// React will automatically provide us with the event `e`
|
21
|
-
_handleChange(e) {
|
22
|
-
const name = e.target.value;
|
23
|
-
this.props._updateName(name);
|
24
|
-
}
|
25
|
-
|
26
|
-
render() {
|
27
|
-
return (
|
28
|
-
<div>
|
29
|
-
<h3>
|
30
|
-
Hello, {this.props.name}!
|
31
|
-
</h3>
|
32
|
-
<p>
|
33
|
-
Say hello to:
|
34
|
-
<input type="text" value={this.props.name} onChange={this._handleChange} />
|
35
|
-
</p>
|
36
|
-
</div>
|
37
|
-
);
|
38
|
-
}
|
39
|
-
}
|
@@ -1,50 +0,0 @@
|
|
1
|
-
// HelloWorldWidget is an arbitrary name for any "dumb" component. We do not recommend suffixing all your
|
2
|
-
// dump component names with Widget.
|
3
|
-
|
4
|
-
import React, { PropTypes } from 'react';
|
5
|
-
import Immutable from 'immutable';
|
6
|
-
import _ from 'lodash';
|
7
|
-
|
8
|
-
// Simple example of a React "dumb" component
|
9
|
-
export default class HelloWorldWidget extends React.Component {
|
10
|
-
static propTypes = {
|
11
|
-
// We prefix all property and variable names pointing to Immutable.js objects with '$$'.
|
12
|
-
// This allows us to immediately know we don't call $$helloWorldStore['someProperty'], but instead use
|
13
|
-
// the Immutable.js `get` API for Immutable.Map
|
14
|
-
actions: PropTypes.shape({
|
15
|
-
updateName: PropTypes.func.isRequired,
|
16
|
-
}).isRequired,
|
17
|
-
$$helloWorldStore: PropTypes.instanceOf(Immutable.Map).isRequired,
|
18
|
-
};
|
19
|
-
|
20
|
-
constructor(props, context) {
|
21
|
-
super(props, context);
|
22
|
-
|
23
|
-
// Uses lodash to bind all methods to the context of the object instance, otherwise
|
24
|
-
// the methods defined here would not refer to the component's class, not the component
|
25
|
-
// instance itself.
|
26
|
-
_.bindAll(this, '_handleChange');
|
27
|
-
}
|
28
|
-
|
29
|
-
// React will automatically provide us with the event `e`
|
30
|
-
_handleChange(e) {
|
31
|
-
const name = e.target.value;
|
32
|
-
this.props.actions.updateName(name);
|
33
|
-
}
|
34
|
-
|
35
|
-
render() {
|
36
|
-
const $$helloWorldStore = this.props.$$helloWorldStore;
|
37
|
-
const name = $$helloWorldStore.get('name');
|
38
|
-
return (
|
39
|
-
<div>
|
40
|
-
<h3>
|
41
|
-
Hello, {name}!
|
42
|
-
</h3>
|
43
|
-
<p>
|
44
|
-
Say hello to:
|
45
|
-
<input type="text" value={name} onChange={this._handleChange} />
|
46
|
-
</p>
|
47
|
-
</div>
|
48
|
-
);
|
49
|
-
}
|
50
|
-
}
|