質問編集履歴
1
コードの抜粋を掲載
test
CHANGED
File without changes
|
test
CHANGED
@@ -42,6 +42,48 @@
|
|
42
42
|
|
43
43
|
|
44
44
|
|
45
|
+
> App.jsxの抜粋
|
46
|
+
|
47
|
+
```js
|
48
|
+
|
49
|
+
function App() {
|
50
|
+
|
51
|
+
const [todos, setTodos] = useState(
|
52
|
+
|
53
|
+
JSON.parse(localStorage.getItem("todos")) || []
|
54
|
+
|
55
|
+
);
|
56
|
+
|
57
|
+
const [inputText, setInputText] = useState("");
|
58
|
+
|
59
|
+
const [editingText, setEditingText] = useState("");
|
60
|
+
|
61
|
+
const [filterState, setFilterState] = useState(FILTER_STATE.ALL);
|
62
|
+
|
63
|
+
|
64
|
+
|
65
|
+
useEffect(() => {
|
66
|
+
|
67
|
+
localStorage.setItem("todos", JSON.stringify(todos));
|
68
|
+
|
69
|
+
});
|
70
|
+
|
71
|
+
|
72
|
+
|
73
|
+
// 1文字ずつしか入力できなくなった。2021/04/16
|
74
|
+
|
75
|
+
function updateInputText(e) {
|
76
|
+
|
77
|
+
setInputText(e.target.value);
|
78
|
+
|
79
|
+
}
|
80
|
+
|
81
|
+
|
82
|
+
|
83
|
+
```
|
84
|
+
|
85
|
+
|
86
|
+
|
45
87
|
### 発生している問題・エラーメッセージ
|
46
88
|
|
47
89
|
|