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

質問編集履歴

6

画像が反映されない

2022/01/12 08:20

投稿

syobon_gun
syobon_gun

スコア1

title CHANGED
File without changes
body CHANGED
@@ -348,7 +348,7 @@
348
348
  ```
349
349
 
350
350
 
351
- ![イメージ説明](https://d1666c7av167g2.cloudfront.net/questions/2022-01-12/962c0110-8f10-44d8-b6a6-62762277eb4b.png)
351
+ ![イメージ説明](https://d1666c7av167g2.cloudfront.net/questions/2022-01-12/b88ee2f6-c48e-4d4c-be3d-6121d996cc7f.png)
352
352
 
353
353
  ### 補足情報(FW/ツールのバージョンなど)
354
354
  VScode

5

画像の更新

2022/01/12 07:31

投稿

syobon_gun
syobon_gun

スコア1

title CHANGED
File without changes
body CHANGED
@@ -345,9 +345,9 @@
345
345
  return i;
346
346
  };
347
347
  }
348
+ ```
348
349
 
349
350
 
350
-
351
351
  ![イメージ説明](https://d1666c7av167g2.cloudfront.net/questions/2022-01-12/962c0110-8f10-44d8-b6a6-62762277eb4b.png)
352
352
 
353
353
  ### 補足情報(FW/ツールのバージョンなど)

4

画像の更新

2022/01/12 07:30

投稿

syobon_gun
syobon_gun

スコア1

title CHANGED
File without changes
body CHANGED
@@ -346,10 +346,10 @@
346
346
  };
347
347
  }
348
348
 
349
+
350
+
349
351
  ![イメージ説明](https://d1666c7av167g2.cloudfront.net/questions/2022-01-12/962c0110-8f10-44d8-b6a6-62762277eb4b.png)
350
352
 
351
- ```
352
-
353
353
  ### 補足情報(FW/ツールのバージョンなど)
354
354
  VScode
355
355
  create-react-app

3

画像の更新

2022/01/12 07:29

投稿

syobon_gun
syobon_gun

スコア1

title CHANGED
File without changes
body CHANGED
@@ -346,10 +346,9 @@
346
346
  };
347
347
  }
348
348
 
349
+ ![イメージ説明](https://d1666c7av167g2.cloudfront.net/questions/2022-01-12/962c0110-8f10-44d8-b6a6-62762277eb4b.png)
349
350
 
350
-
351
351
  ```
352
- ![イメージ説明](https://d1666c7av167g2.cloudfront.net/questions/2022-01-12/381330fa-6a36-4749-a0ce-e3b9c2448d21.png)
353
352
 
354
353
  ### 補足情報(FW/ツールのバージョンなど)
355
354
  VScode

2

2022/01/12 07:28

投稿

syobon_gun
syobon_gun

スコア1

title CHANGED
File without changes
body CHANGED
@@ -1,359 +1,356 @@
1
- ### 前提・実現したいこと
2
- create-react-appを使ってカレンダーアプリを作っています。カレンダーの表示や予定の登録削除はできるのですが、日付を範囲選択した際に出てほしい予定の登録の画面が常に表示されてしまいます。エラーなどは特にでていないのですがなぜこうなるかわかりません。ご助言お願いします
3
-
4
-
5
-
6
-
7
- ```ここに言語を入力
8
-
9
- render() {
10
- return (
11
- <div>
12
- {this.renderCover()}
13
- {this.renderForm()}
14
- <div className="container">
15
- <FullCalendar
16
- locale="ja"
17
- defaultView="timeGridWeek"
18
- slotDuration="00:30:00"
19
- selectable={true}
20
- allDaySlot={false}
21
- // navLinks={true}
22
- titleFormat={{
23
- year: "numeric",
24
- month: "short",
25
- day: "numeric",
26
- }}
27
- header={{
28
- start: 'title',
29
- center: 'prev, next, today',
30
- end: 'dayGridMonth,timeGridWeek,'
31
- }}
32
- businessHours={{
33
- daysOfWeek: [1, 2, 3, 4, 5],
34
- startTime: "0:00",
35
- endTime: "24:00",
36
- }}
37
- plugins={[dayGridPlugin, timeGridPlugin, interactionPlugin]}
38
- ref={this.ref}
39
- weekends={true}
40
- events={this.myEvents}
41
- eventClick={this.handleClick}
42
- select={this.handleSelect}
43
- eventMouseEnter={this.handleMouseEnt}
44
- eventMouseLeave={this.handleMouseLev}
45
- eventDragStart={this.handleDragStart}
46
- eventDrop={this.handleDrop}
47
- eventResize={this.handleResize}
48
- dateClick={this.handledateClick}
49
- eventRender={this.handleRender}
50
- />
51
- </div>
52
- </div>
53
- );
54
- }
55
-
56
- handleSelect = (selectInfo) => {
57
- let start = new Date(selectInfo.start);
58
- let end = new Date(selectInfo.end);
59
- start.setHours(start.getHours());
60
- end.setHours(end.getHours());
61
-
62
- this.setState({ inputTitle: "" });
63
- this.setState({ inputMemo: "" });
64
- this.setState({ isInputTitle: false });
65
- this.setState({ inputStart: start });
66
- this.setState({ inputEnd: end });
67
- this.setState({ isChange: false });
68
- this.setState({ formInview: true });
69
- };
70
-
71
- handleClick = (info) => {
72
- this.selEventID = info.event.id;
73
- const selEvent = this.myEvents[info.event.id];
74
- const title = selEvent.title;
75
- const memo = selEvent.memo;
76
- const start = new Date(selEvent.start);
77
- const end = new Date(selEvent.end);
78
-
79
- this.setState({ inputTitle: title });
80
- this.setState({ inputMemo: memo });
81
- this.setState({ isInputTitle: true });
82
- this.setState({ inputStart: start });
83
- this.setState({ inputEnd: end });
84
- this.setState({ isChange: true });
85
- this.setState({ formInview: true });
86
- };
87
-
88
- renderCover() {
89
- return (
90
- <div
91
- onClick={() => {
92
- this.setState({ formInview: false });
93
- }}
94
- className={
95
- this.state.formInview
96
- ? "container__cover inview"
97
- : "container__cover "
98
- }
99
- ></div>
100
- );
101
- }
102
-
103
-
104
- renderForm() {
105
- return (
106
- <div
107
- className={
108
- this.state.formInview ? "container__form inview" : "container__form"
109
- }
110
- >
111
- <form>
112
- {this.state.isChange === false ? (
113
- <div className="container__form__header">予定を入力</div>
114
- ) : (
115
- <div className="container__form__header">予定を変更</div>
116
- )}
117
-
118
- <div>{this.renderTitle()}</div>
119
- <div>{this.renderStartTime()}</div>
120
- <div>{this.renderEndTime()}</div>
121
- <div>{this.renderMemo()}</div>
122
- <div>{this.renderBtn()}</div>
123
- </form>
124
- </div>
125
- );
126
- }
127
- renderTitle() {
128
- return (
129
- <React.Fragment>
130
- <p className="container__form__label">タイトル</p>
131
- <input
132
- className="container__form__title"
133
- type="text"
134
- value={this.state.inputTitle}
135
- onChange={(e) => {
136
- this.setState({ inputTitle: e.target.value });
137
-
138
- if (e.target.value === "") {
139
- this.setState({ isInputTitle: false });
140
- } else {
141
- this.setState({ isInputTitle: true });
142
- }
143
- }}
144
- />
145
- </React.Fragment>
146
- );
147
- }
148
- renderMemo() {
149
- return (
150
- <React.Fragment>
151
- <p className="container__form__label">メモ</p>
152
- <textarea
153
- className="container__form__memo"
154
- rows="3"
155
- value={this.state.inputMemo}
156
- onChange={(e) => {
157
- this.setState({ inputMemo: e.target.value });
158
- }}
159
- />
160
- </React.Fragment>
161
- );
162
- }
163
- renderStartTime() {
164
- return (
165
- <React.Fragment>
166
- <p className="container__form__label">開始日時</p>
167
- <DatePicker
168
- className="container__form__datetime"
169
- locale="ja"
170
- dateFormat="yyyy/MM/d HH:mm"
171
- selected={this.state.inputStart}
172
- showTimeSelect
173
- timeFormat="HH:mm"
174
- timeIntervals={15}
175
- todayButton="today"
176
- onChange={(time) => {
177
- this.setState({ inputStart: time });
178
- }}
179
- />
180
- </React.Fragment>
181
- );
182
- }
183
- renderEndTime() {
184
- return (
185
- <React.Fragment>
186
- <p className="container__form__label">終了日時</p>
187
- <DatePicker
188
- className="container__form__datetime"
189
- locale="ja"
190
- dateFormat="yyyy/MM/d HH:mm"
191
- selected={this.state.inputEnd}
192
- showTimeSelect
193
- timeFormat="HH:mm"
194
- timeIntervals={10}
195
- todayButton="today"
196
- onChange={(time) => {
197
- this.setState({ inputEnd: time });
198
- }}
199
- />
200
- </React.Fragment>
201
- );
202
- }
203
- renderBtn() {
204
- return (
205
- <div>
206
- {this.state.isChange === false ? (
207
- <div>
208
- <input
209
- className="container__form__btn_cancel"
210
- type="button"
211
- value="キャンセル"
212
- onClick={() => {
213
- this.setState({ formInview: false });
214
- }}
215
- />
216
- <input
217
- className="container__form__btn_save"
218
- type="button"
219
- value="保存"
220
- disabled={!this.state.isInputTitle}
221
- onClick={this.onAddEvent}
222
- />
223
- </div>
224
- ) : (
225
- <div>
226
- <input
227
- className="container__form__btn_delete"
228
- type="button"
229
- value="削除"
230
- onClick={this.onDeleteEvent}
231
- />
232
- <input
233
- className="container__form__btn_save"
234
- type="button"
235
- value="変更"
236
- onClick={this.onChangeEvent}
237
- />
238
- </div>
239
- )}
240
- </div>
241
- );
242
- }
243
-
244
- getdoubleDigestNumer(number) {
245
- return ("0" + number).slice(-2);
246
- }
247
- changeDateToString(dt) {
248
- const year = dt.getFullYear();
249
- const month = this.getdoubleDigestNumer(dt.getMonth() + 1);
250
- const date = this.getdoubleDigestNumer(dt.getDate());
251
- const hour = this.getdoubleDigestNumer(dt.getHours());
252
- const minutes = this.getdoubleDigestNumer(dt.getMinutes());
253
-
254
- const retDate = `${year}-${month}-${date} ${hour}:${minutes}:00`;
255
- return retDate;
256
- }
257
- onAddEvent() {
258
- const starttime = this.changeDateToString(this.state.inputStart);
259
- const endtime = this.changeDateToString(this.state.inputEnd);
260
-
261
- if (starttime >= endtime) {
262
- alert("開始時間と終了時間を確認してください。");
263
- return;
264
- }
265
- const event = {
266
- title: this.state.inputTitle,
267
- memo: this.state.inputMemo,
268
- start: starttime,
269
- end: endtime,
270
- };
271
- if (this.addEvent(event) === true) {
272
- window.alert("設定しました");
273
- this.setState({ formInview: false });
274
- }
275
- }
276
- onChangeEvent(values) {
277
- if (window.confirm("変更しますか?")) {
278
- const starttime = this.changeDateToString(this.state.inputStart);
279
- const endtime = this.changeDateToString(this.state.inputEnd);
280
-
281
- if (starttime >= endtime) {
282
- alert("開始時間と終了時間を確認してください。");
283
- return;
284
- }
285
-
286
- const event = {
287
- title: this.state.inputTitle,
288
- memo: this.state.inputMemo,
289
- start: starttime,
290
- end: endtime,
291
- id: this.selEventID,
292
- };
293
- if (this.changeEvent(event) === true) {
294
- window.alert("イベントを変更しました。");
295
- this.setState({ formInview: false });
296
- }
297
- } else {
298
- return;
299
- }
300
- }
301
- onDeleteEvent(values) {
302
- if (window.confirm("削除しますか?")) {
303
- if (this.selEventID < this.EVENT_SEL_NON) {
304
- let EventID = this.selEventID;
305
- let delevent = this.ref.current.getApi().getEventById(EventID);
306
- delevent.remove();
307
- this.selEventID = this.EVENT_SEL_NON;
308
- this.myEvents[EventID].isDel = true;
309
- }
310
- this.setState({ formInview: false });
311
- alert("イベントを削除しました。");
312
- } else {
313
- return;
314
- }
315
- }
316
- addEvent = (ev, col) => {
317
- ev.id = this.getID();
318
- this.myEvents.push(ev);
319
- this.ref.current.getApi().addEvent(ev);
320
-
321
- return true;
322
- };
323
- changeEvent = (ev, col = "red") => {
324
- this.myEvents[ev.id].title = ev.title;
325
- this.myEvents[ev.id].memo = ev.memo;
326
- this.myEvents[ev.id].start = ev.start;
327
- this.myEvents[ev.id].end = ev.end;
328
-
329
- this.ref.current.getApi().getEventById(ev.id).remove();
330
- this.ref.current.getApi().addEvent(this.myEvents[ev.id]);
331
-
332
- return true;
333
- };
334
- sortEventID = (a, b) => {
335
- return a.id < b.id ? -1 : a.id > b.id ? 1 : 0;
336
- };
337
- getID = () => {
338
- this.myEvents.sort(this.sortEventID);
339
- let i;
340
- for (i = 0; i < this.myEvents.length; i++) {
341
- if (this.myEvents[i].id !== i) {
342
- break;
343
- }
344
- }
345
- return i;
346
- };
347
- }
348
-
349
-
350
-
351
- ```
352
-
353
- ![イメージ説明](e918a4e9d1fe72ed0feb7ac3915f05ac.png)
354
-
355
-
356
-
357
- ### 補足情報(FW/ツールのバージョンなど)
358
- VScode
1
+ ### 前提・実現したいこと
2
+ create-react-appを使ってカレンダーアプリを作っています。カレンダーの表示や予定の登録削除はできるのですが、日付を範囲選択した際に出てほしい予定の登録の画面が常に表示されてしまいます。エラーなどは特にでていないのですがなぜこうなるかわかりません。ご助言お願いします
3
+
4
+
5
+
6
+
7
+ ```ここに言語を入力
8
+
9
+ render() {
10
+ return (
11
+ <div>
12
+ {this.renderCover()}
13
+ {this.renderForm()}
14
+ <div className="container">
15
+ <FullCalendar
16
+ locale="ja"
17
+ defaultView="timeGridWeek"
18
+ slotDuration="00:30:00"
19
+ selectable={true}
20
+ allDaySlot={false}
21
+ // navLinks={true}
22
+ titleFormat={{
23
+ year: "numeric",
24
+ month: "short",
25
+ day: "numeric",
26
+ }}
27
+ header={{
28
+ start: 'title',
29
+ center: 'prev, next, today',
30
+ end: 'dayGridMonth,timeGridWeek,'
31
+ }}
32
+ businessHours={{
33
+ daysOfWeek: [1, 2, 3, 4, 5],
34
+ startTime: "0:00",
35
+ endTime: "24:00",
36
+ }}
37
+ plugins={[dayGridPlugin, timeGridPlugin, interactionPlugin]}
38
+ ref={this.ref}
39
+ weekends={true}
40
+ events={this.myEvents}
41
+ eventClick={this.handleClick}
42
+ select={this.handleSelect}
43
+ eventMouseEnter={this.handleMouseEnt}
44
+ eventMouseLeave={this.handleMouseLev}
45
+ eventDragStart={this.handleDragStart}
46
+ eventDrop={this.handleDrop}
47
+ eventResize={this.handleResize}
48
+ dateClick={this.handledateClick}
49
+ eventRender={this.handleRender}
50
+ />
51
+ </div>
52
+ </div>
53
+ );
54
+ }
55
+
56
+ handleSelect = (selectInfo) => {
57
+ let start = new Date(selectInfo.start);
58
+ let end = new Date(selectInfo.end);
59
+ start.setHours(start.getHours());
60
+ end.setHours(end.getHours());
61
+
62
+ this.setState({ inputTitle: "" });
63
+ this.setState({ inputMemo: "" });
64
+ this.setState({ isInputTitle: false });
65
+ this.setState({ inputStart: start });
66
+ this.setState({ inputEnd: end });
67
+ this.setState({ isChange: false });
68
+ this.setState({ formInview: true });
69
+ };
70
+
71
+ handleClick = (info) => {
72
+ this.selEventID = info.event.id;
73
+ const selEvent = this.myEvents[info.event.id];
74
+ const title = selEvent.title;
75
+ const memo = selEvent.memo;
76
+ const start = new Date(selEvent.start);
77
+ const end = new Date(selEvent.end);
78
+
79
+ this.setState({ inputTitle: title });
80
+ this.setState({ inputMemo: memo });
81
+ this.setState({ isInputTitle: true });
82
+ this.setState({ inputStart: start });
83
+ this.setState({ inputEnd: end });
84
+ this.setState({ isChange: true });
85
+ this.setState({ formInview: true });
86
+ };
87
+
88
+ renderCover() {
89
+ return (
90
+ <div
91
+ onClick={() => {
92
+ this.setState({ formInview: false });
93
+ }}
94
+ className={
95
+ this.state.formInview
96
+ ? "container__cover inview"
97
+ : "container__cover "
98
+ }
99
+ ></div>
100
+ );
101
+ }
102
+
103
+
104
+ renderForm() {
105
+ return (
106
+ <div
107
+ className={
108
+ this.state.formInview ? "container__form inview" : "container__form"
109
+ }
110
+ >
111
+ <form>
112
+ {this.state.isChange === false ? (
113
+ <div className="container__form__header">予定を入力</div>
114
+ ) : (
115
+ <div className="container__form__header">予定を変更</div>
116
+ )}
117
+
118
+ <div>{this.renderTitle()}</div>
119
+ <div>{this.renderStartTime()}</div>
120
+ <div>{this.renderEndTime()}</div>
121
+ <div>{this.renderMemo()}</div>
122
+ <div>{this.renderBtn()}</div>
123
+ </form>
124
+ </div>
125
+ );
126
+ }
127
+ renderTitle() {
128
+ return (
129
+ <React.Fragment>
130
+ <p className="container__form__label">タイトル</p>
131
+ <input
132
+ className="container__form__title"
133
+ type="text"
134
+ value={this.state.inputTitle}
135
+ onChange={(e) => {
136
+ this.setState({ inputTitle: e.target.value });
137
+
138
+ if (e.target.value === "") {
139
+ this.setState({ isInputTitle: false });
140
+ } else {
141
+ this.setState({ isInputTitle: true });
142
+ }
143
+ }}
144
+ />
145
+ </React.Fragment>
146
+ );
147
+ }
148
+ renderMemo() {
149
+ return (
150
+ <React.Fragment>
151
+ <p className="container__form__label">メモ</p>
152
+ <textarea
153
+ className="container__form__memo"
154
+ rows="3"
155
+ value={this.state.inputMemo}
156
+ onChange={(e) => {
157
+ this.setState({ inputMemo: e.target.value });
158
+ }}
159
+ />
160
+ </React.Fragment>
161
+ );
162
+ }
163
+ renderStartTime() {
164
+ return (
165
+ <React.Fragment>
166
+ <p className="container__form__label">開始日時</p>
167
+ <DatePicker
168
+ className="container__form__datetime"
169
+ locale="ja"
170
+ dateFormat="yyyy/MM/d HH:mm"
171
+ selected={this.state.inputStart}
172
+ showTimeSelect
173
+ timeFormat="HH:mm"
174
+ timeIntervals={15}
175
+ todayButton="today"
176
+ onChange={(time) => {
177
+ this.setState({ inputStart: time });
178
+ }}
179
+ />
180
+ </React.Fragment>
181
+ );
182
+ }
183
+ renderEndTime() {
184
+ return (
185
+ <React.Fragment>
186
+ <p className="container__form__label">終了日時</p>
187
+ <DatePicker
188
+ className="container__form__datetime"
189
+ locale="ja"
190
+ dateFormat="yyyy/MM/d HH:mm"
191
+ selected={this.state.inputEnd}
192
+ showTimeSelect
193
+ timeFormat="HH:mm"
194
+ timeIntervals={10}
195
+ todayButton="today"
196
+ onChange={(time) => {
197
+ this.setState({ inputEnd: time });
198
+ }}
199
+ />
200
+ </React.Fragment>
201
+ );
202
+ }
203
+ renderBtn() {
204
+ return (
205
+ <div>
206
+ {this.state.isChange === false ? (
207
+ <div>
208
+ <input
209
+ className="container__form__btn_cancel"
210
+ type="button"
211
+ value="キャンセル"
212
+ onClick={() => {
213
+ this.setState({ formInview: false });
214
+ }}
215
+ />
216
+ <input
217
+ className="container__form__btn_save"
218
+ type="button"
219
+ value="保存"
220
+ disabled={!this.state.isInputTitle}
221
+ onClick={this.onAddEvent}
222
+ />
223
+ </div>
224
+ ) : (
225
+ <div>
226
+ <input
227
+ className="container__form__btn_delete"
228
+ type="button"
229
+ value="削除"
230
+ onClick={this.onDeleteEvent}
231
+ />
232
+ <input
233
+ className="container__form__btn_save"
234
+ type="button"
235
+ value="変更"
236
+ onClick={this.onChangeEvent}
237
+ />
238
+ </div>
239
+ )}
240
+ </div>
241
+ );
242
+ }
243
+
244
+ getdoubleDigestNumer(number) {
245
+ return ("0" + number).slice(-2);
246
+ }
247
+ changeDateToString(dt) {
248
+ const year = dt.getFullYear();
249
+ const month = this.getdoubleDigestNumer(dt.getMonth() + 1);
250
+ const date = this.getdoubleDigestNumer(dt.getDate());
251
+ const hour = this.getdoubleDigestNumer(dt.getHours());
252
+ const minutes = this.getdoubleDigestNumer(dt.getMinutes());
253
+
254
+ const retDate = `${year}-${month}-${date} ${hour}:${minutes}:00`;
255
+ return retDate;
256
+ }
257
+ onAddEvent() {
258
+ const starttime = this.changeDateToString(this.state.inputStart);
259
+ const endtime = this.changeDateToString(this.state.inputEnd);
260
+
261
+ if (starttime >= endtime) {
262
+ alert("開始時間と終了時間を確認してください。");
263
+ return;
264
+ }
265
+ const event = {
266
+ title: this.state.inputTitle,
267
+ memo: this.state.inputMemo,
268
+ start: starttime,
269
+ end: endtime,
270
+ };
271
+ if (this.addEvent(event) === true) {
272
+ window.alert("設定しました");
273
+ this.setState({ formInview: false });
274
+ }
275
+ }
276
+ onChangeEvent(values) {
277
+ if (window.confirm("変更しますか?")) {
278
+ const starttime = this.changeDateToString(this.state.inputStart);
279
+ const endtime = this.changeDateToString(this.state.inputEnd);
280
+
281
+ if (starttime >= endtime) {
282
+ alert("開始時間と終了時間を確認してください。");
283
+ return;
284
+ }
285
+
286
+ const event = {
287
+ title: this.state.inputTitle,
288
+ memo: this.state.inputMemo,
289
+ start: starttime,
290
+ end: endtime,
291
+ id: this.selEventID,
292
+ };
293
+ if (this.changeEvent(event) === true) {
294
+ window.alert("イベントを変更しました。");
295
+ this.setState({ formInview: false });
296
+ }
297
+ } else {
298
+ return;
299
+ }
300
+ }
301
+ onDeleteEvent(values) {
302
+ if (window.confirm("削除しますか?")) {
303
+ if (this.selEventID < this.EVENT_SEL_NON) {
304
+ let EventID = this.selEventID;
305
+ let delevent = this.ref.current.getApi().getEventById(EventID);
306
+ delevent.remove();
307
+ this.selEventID = this.EVENT_SEL_NON;
308
+ this.myEvents[EventID].isDel = true;
309
+ }
310
+ this.setState({ formInview: false });
311
+ alert("イベントを削除しました。");
312
+ } else {
313
+ return;
314
+ }
315
+ }
316
+ addEvent = (ev, col) => {
317
+ ev.id = this.getID();
318
+ this.myEvents.push(ev);
319
+ this.ref.current.getApi().addEvent(ev);
320
+
321
+ return true;
322
+ };
323
+ changeEvent = (ev, col = "red") => {
324
+ this.myEvents[ev.id].title = ev.title;
325
+ this.myEvents[ev.id].memo = ev.memo;
326
+ this.myEvents[ev.id].start = ev.start;
327
+ this.myEvents[ev.id].end = ev.end;
328
+
329
+ this.ref.current.getApi().getEventById(ev.id).remove();
330
+ this.ref.current.getApi().addEvent(this.myEvents[ev.id]);
331
+
332
+ return true;
333
+ };
334
+ sortEventID = (a, b) => {
335
+ return a.id < b.id ? -1 : a.id > b.id ? 1 : 0;
336
+ };
337
+ getID = () => {
338
+ this.myEvents.sort(this.sortEventID);
339
+ let i;
340
+ for (i = 0; i < this.myEvents.length; i++) {
341
+ if (this.myEvents[i].id !== i) {
342
+ break;
343
+ }
344
+ }
345
+ return i;
346
+ };
347
+ }
348
+
349
+
350
+
351
+ ```
352
+ ![イメージ説明](https://d1666c7av167g2.cloudfront.net/questions/2022-01-12/381330fa-6a36-4749-a0ce-e3b9c2448d21.png)
353
+
354
+ ### 補足情報(FW/ツールのバージョンなど)
355
+ VScode
359
356
  create-react-app

1

React.jsのタグを追加しました。

2022/01/11 14:34

投稿

syobon_gun
syobon_gun

スコア1

title CHANGED
File without changes
body CHANGED
File without changes