import * as React from 'react'; hook useH(ref: React.RefObject) { ref.current; // error } component Foo() { const x = React.useRef(); useH(x); // ok return null; }