質問編集履歴
4
コンポーネント追記
test
CHANGED
File without changes
|
test
CHANGED
@@ -290,6 +290,22 @@
|
|
290
290
|
|
291
291
|
|
292
292
|
|
293
|
+
components / names / Names.js
|
294
|
+
|
295
|
+
```
|
296
|
+
|
297
|
+
const mapStateToProps = (state, props) => {
|
298
|
+
|
299
|
+
return {
|
300
|
+
|
301
|
+
word: state.names.names.word,
|
302
|
+
|
303
|
+
}
|
304
|
+
|
305
|
+
```
|
306
|
+
|
307
|
+
|
308
|
+
|
293
309
|
|
294
310
|
|
295
311
|
modules/reducer.js
|
3
reducer.jsの内容追記
test
CHANGED
File without changes
|
test
CHANGED
@@ -226,7 +226,7 @@
|
|
226
226
|
|
227
227
|
│ ├ components/
|
228
228
|
|
229
|
-
│ │ ├ names
|
229
|
+
│ │ ├ names
|
230
230
|
|
231
231
|
│ │ │ └ Names.js
|
232
232
|
|
@@ -266,6 +266,8 @@
|
|
266
266
|
|
267
267
|
|
268
268
|
|
269
|
+
|
270
|
+
|
269
271
|
### 試してみたこと
|
270
272
|
|
271
273
|
|
@@ -284,4 +286,64 @@
|
|
284
286
|
|
285
287
|
|
286
288
|
|
289
|
+
### 追記
|
290
|
+
|
291
|
+
|
292
|
+
|
293
|
+
|
294
|
+
|
295
|
+
modules/reducer.js
|
296
|
+
|
297
|
+
```js
|
298
|
+
|
299
|
+
import { combineReducers } from 'redux'
|
300
|
+
|
301
|
+
import { routerReducer } from 'react-router-redux'
|
302
|
+
|
303
|
+
|
304
|
+
|
305
|
+
import names from '@/modules/names/reducer'
|
306
|
+
|
307
|
+
|
308
|
+
|
309
|
+
export default combineReducers({
|
310
|
+
|
311
|
+
names,
|
312
|
+
|
313
|
+
routing: routerReducer,
|
314
|
+
|
315
|
+
})
|
316
|
+
|
317
|
+
```
|
318
|
+
|
319
|
+
|
320
|
+
|
321
|
+
modules/names/reducer.js
|
322
|
+
|
323
|
+
```js
|
324
|
+
|
325
|
+
import { combineReducers } from 'redux'
|
326
|
+
|
327
|
+
import names from '@/modules/names/names'
|
328
|
+
|
329
|
+
|
330
|
+
|
331
|
+
export default (state = {}, action) => {
|
332
|
+
|
333
|
+
return combineReducers({
|
334
|
+
|
335
|
+
names,
|
336
|
+
|
337
|
+
})(state, action)
|
338
|
+
|
339
|
+
}
|
340
|
+
|
341
|
+
|
342
|
+
|
343
|
+
```
|
344
|
+
|
345
|
+
|
346
|
+
|
347
|
+
|
348
|
+
|
287
349
|
よろしくお願いします。
|
2
ファイル名の変更
test
CHANGED
File without changes
|
test
CHANGED
@@ -272,11 +272,11 @@
|
|
272
272
|
|
273
273
|
tests/sample.test.jsの下記部分をコメントアウトしたところ、上記のエラーはでなったので、
|
274
274
|
|
275
|
-
/modules/names/n
|
275
|
+
/modules/names/names.js内でエラーが出ているのでは、と考えましたが、
|
276
276
|
|
277
277
|
それ以上どこを検証すればいいのかわからずにいます。
|
278
278
|
|
279
|
-
→import reducer, { initialState } from '@/modules/
|
279
|
+
→import reducer, { initialState } from '@/modules/names/names'
|
280
280
|
|
281
281
|
※reducerはありませんというエラーは出ましたが...
|
282
282
|
|
1
test/sample.test.js @/modules/stores/storesManagementを@/modules/names/names'に変更
test
CHANGED
File without changes
|
test
CHANGED
@@ -106,7 +106,7 @@
|
|
106
106
|
|
107
107
|
import App from '@/components/App'
|
108
108
|
|
109
|
-
import reducer, { initialState } from '@/modules/
|
109
|
+
import reducer, { initialState } from '@/modules/names/names' // エラー
|
110
110
|
|
111
111
|
|
112
112
|
|