teratail header banner
teratail header banner
質問するログイン新規登録

質問編集履歴

3

タイトルの誤記を訂正しました。

2020/05/27 16:55

投稿

haku-bot
haku-bot

スコア1

title CHANGED
@@ -1,1 +1,1 @@
1
- Redux Toolkit で useDispatch が実行できません | Reach Hooks + Redux Toolkit + TypeScript
1
+ Redux Toolkit で useDispatch が実行できません | React Hooks + Redux Toolkit + TypeScript
body CHANGED
File without changes

2

期待される挙動を追加しました。

2020/05/27 16:54

投稿

haku-bot
haku-bot

スコア1

title CHANGED
File without changes
body CHANGED
@@ -10,9 +10,9 @@
10
10
  ```
11
11
  Initial state: hoge
12
12
  Action: fuga
13
- Update state: hoge
13
+ Update state: fuga
14
14
  ```
15
- るはずですが、以下の状態でございます。
15
+ 期待出来るはずですが、以下の状態でございます。
16
16
 
17
17
  ![イメージ説明](6ee16b35ede72667df02b90fe7274822.png)
18
18
 

1

ファイル名の記入を行いました。

2020/05/27 16:51

投稿

haku-bot
haku-bot

スコア1

title CHANGED
File without changes
body CHANGED
@@ -18,7 +18,8 @@
18
18
 
19
19
 
20
20
  ### 該当のソースコード
21
+ ```
21
- ```pages/SignUp/index.tsx
22
+ # pages/SignUp/index.tsx
22
23
  import React from 'react';
23
24
  import { useDispatch, useSelector } from "react-redux";
24
25
  import { googleSignup } from "../../stores/auth";
@@ -44,7 +45,8 @@
44
45
 
45
46
  export default SignUp
46
47
  ```
48
+ ```
47
- ```stores/auth.ts
49
+ # stores/auth.ts
48
50
  import { createSlice } from '@reduxjs/toolkit';
49
51
 
50
52
  export type State = {
@@ -74,7 +76,8 @@
74
76
 
75
77
  ```
76
78
 
79
+ ```
77
- ```/index.ts
80
+ # /index.ts
78
81
  import React from 'react';
79
82
  import ReactDOM from 'react-dom';
80
83
  import { Provider } from "react-redux";
@@ -97,7 +100,9 @@
97
100
  );
98
101
  ```
99
102
 
103
+ ```
100
- ```stores/index.ts
104
+ # stores/index.ts
105
+
101
106
  import { combineReducers } from "redux";
102
107
  import { configureStore } from "@reduxjs/toolkit";
103
108
 
@@ -113,7 +118,6 @@
113
118
  export type AppDispatch = typeof Store.dispatch
114
119
 
115
120
  export default Store;
116
-
117
121
  ```
118
122
 
119
123
  ### 試したこと