useRef在ts上的报错,类型 never 上不存在属性'xxx',正确的声明

type tableAction<T> = {
  getTableData: () => T;
//SupplierTable返回的form里的搜索条件对象
type formObjectState = {
  code: string;
  grade: string;
  name: string;
  productType: string;
  region: string;
  status: string;
  type: string;
const tableRef = useRef<tableAction<formObjectState>>(null);
<a href="#" onClick={() => {
         let temp = tableRef?.current?.getTableData();
         console.log('====添加', temp);
         setFormObject(temp);