質問編集履歴
4
質問の解答
test
CHANGED
File without changes
|
test
CHANGED
@@ -10,6 +10,32 @@
|
|
10
10
|
|
11
11
|
|
12
12
|
|
13
|
+
### コンソール出力
|
14
|
+
|
15
|
+
```
|
16
|
+
|
17
|
+
action @@router/CALL_HISTORY_METHOD @ 23:59:06.455
|
18
|
+
|
19
|
+
redux-logger.js:388 prev state {noop: {…}, shopping: {…}, Ranking: {…}, router: {…}}Ranking: {category: undefined, ranking: undefined, error: false}noop: {}router: {location: {…}, action: "POP"}shopping: {categories: Array(3)}__proto__: Object
|
20
|
+
|
21
|
+
redux-logger.js:392 action {type: "@@router/CALL_HISTORY_METHOD", payload: {…}}payload: {method: "push", args: Array(1)}args: ["/category/2502"]method: "push"__proto__: Objecttype: "@@router/CALL_HISTORY_METHOD"__proto__: Object
|
22
|
+
|
23
|
+
redux-logger.js:401 next state {noop: {…}, shopping: {…}, Ranking: {…}, router: {…}}Ranking: {category: undefined, ranking: undefined, error: false}noop: {}router: {location: {…}, action: "POP"}shopping: {categories: Array(3)}__proto__: Object
|
24
|
+
|
25
|
+
redux-logger.js:377 action @@router/LOCATION_CHANGE @ 23:59:06.457
|
26
|
+
|
27
|
+
redux-logger.js:388 prev state {noop: {…}, shopping: {…}, Ranking: {…}, router: {…}}
|
28
|
+
|
29
|
+
redux-logger.js:392 action {type: "@@router/LOCATION_CHANGE", payload: {…}}payload: {location: {…}, action: "PUSH", isFirstRendering: false}type: "@@router/LOCATION_CHANGE"__proto__: Object
|
30
|
+
|
31
|
+
redux-logger.js:401 next state {noop: {…}, shopping: {…}, Ranking: {…}, router: {…}}
|
32
|
+
|
33
|
+
```
|
34
|
+
|
35
|
+
|
36
|
+
|
37
|
+
|
38
|
+
|
13
39
|
### 該当のソースコード
|
14
40
|
|
15
41
|
createStore.js
|
3
質問の解答
test
CHANGED
File without changes
|
test
CHANGED
@@ -12,6 +12,64 @@
|
|
12
12
|
|
13
13
|
### 該当のソースコード
|
14
14
|
|
15
|
+
createStore.js
|
16
|
+
|
17
|
+
```
|
18
|
+
|
19
|
+
import {
|
20
|
+
|
21
|
+
createStore as reduxCreateStore,
|
22
|
+
|
23
|
+
combineReducers,
|
24
|
+
|
25
|
+
applyMiddleware
|
26
|
+
|
27
|
+
} from 'redux';
|
28
|
+
|
29
|
+
import logger from 'redux-logger';
|
30
|
+
|
31
|
+
import thunk from 'redux-thunk';
|
32
|
+
|
33
|
+
import { connectRouter, routerMiddleware } from 'connected-react-router';
|
34
|
+
|
35
|
+
|
36
|
+
|
37
|
+
import * as reducers from './reducers';
|
38
|
+
|
39
|
+
|
40
|
+
|
41
|
+
export default function createStore(history) {
|
42
|
+
|
43
|
+
return reduxCreateStore(
|
44
|
+
|
45
|
+
combineReducers({
|
46
|
+
|
47
|
+
...reducers,
|
48
|
+
|
49
|
+
router: connectRouter(history), //ルーター状態を管理するルーターreducer
|
50
|
+
|
51
|
+
}),
|
52
|
+
|
53
|
+
applyMiddleware(
|
54
|
+
|
55
|
+
logger,
|
56
|
+
|
57
|
+
thunk,
|
58
|
+
|
59
|
+
routerMiddleware(history)
|
60
|
+
|
61
|
+
)
|
62
|
+
|
63
|
+
);
|
64
|
+
|
65
|
+
}
|
66
|
+
|
67
|
+
```
|
68
|
+
|
69
|
+
|
70
|
+
|
71
|
+
|
72
|
+
|
15
73
|
index.js
|
16
74
|
|
17
75
|
```index.js
|
2
変更
test
CHANGED
File without changes
|
test
CHANGED
@@ -377,3 +377,5 @@
|
|
377
377
|
[https://github.com/supasate/connected-react-router/issues/260](https://github.com/supasate/connected-react-router/issues/260)
|
378
378
|
|
379
379
|
上記のサイトにバージョンを6.0.0にダウングレードさせるように記述されていましたが、試してみても変わりませんでした。
|
380
|
+
|
381
|
+
react-router-domとconnected-react-routerが依存関係があるようで、上の記事に書かれている場合すべての通りを試してみましたが、変化なしです。
|
1
変更
test
CHANGED
File without changes
|
test
CHANGED
@@ -369,3 +369,11 @@
|
|
369
369
|
}
|
370
370
|
|
371
371
|
```
|
372
|
+
|
373
|
+
|
374
|
+
|
375
|
+
###試したこと
|
376
|
+
|
377
|
+
[https://github.com/supasate/connected-react-router/issues/260](https://github.com/supasate/connected-react-router/issues/260)
|
378
|
+
|
379
|
+
上記のサイトにバージョンを6.0.0にダウングレードさせるように記述されていましたが、試してみても変わりませんでした。
|