質問編集履歴

1

const childComponent = forwardRef((ref) => { の文法部分を修正

2023/06/21 14:09

投稿

mog
mog

スコア1

test CHANGED
File without changes
test CHANGED
@@ -19,7 +19,7 @@
19
19
  ```React.js
20
20
  import React, { useImperativeHandle, forwardRef, useRef } from "react";
21
21
 
22
- const childComponent = forwardRef(ref) => {
22
+ const childComponent = forwardRef((ref) => {
23
23
  const handleShow = () => {
24
24
  showAlert()
25
25
  };
@@ -38,7 +38,8 @@
38
38
  onClick={handleShow}
39
39
  >
40
40
  </Button>
41
+ )
41
- };
42
+ });
42
43
 
43
44
 
44
45
  const parentComponent = () => {