Typescript, how to pass “Object is possibly null” error?

前端 未结 5 1868
谎友^
谎友^ 2021-02-05 00:16

I\'ve got the \"Object is possibly null\" error many times and usually I use a safety \"if statement\" in case it returns null.

I\'ve got the following function:

<
5条回答
  •  无人及你
    2021-02-05 00:40

    If you want to "pass/skip" then this will do it const overlayEl: any = useRef(null);

提交回复
热议问题