react 使用ref报错 Attempts to access this ref will fail. Did you mean to use React.forwardRef()?

这是官网里面的

img

这是我自己写的子组件:

img

img

这是父组件的引用:

img

img

能正常打开,但是报错

img

我尝试用网上的方法都不行,我不知道怎么改成不用hook的,想请教到底这个React.forwardRef()要怎么加?