I have this component:
const TableWrapper = <T extends {}>
({
fields,
values,
items,
limit,
currentPage,
keyword,
showIndex,
className,
ref
}: TableWrapperProps<T>): JSX.Element => {
// ...
}
export default React.forwardRef(TableWrapper) // Problem
And I need to export it with forwardRef
, but I'm getting the following error:
Expected 0 type arguments, but got 1. TS2558
122 | {/* Table Wrapper */}
123 | { !isValidating ? (
> 124 | <TableWrapper<T>
| ^
125 | className={className}
126 | fields={fields}
127 | values={values}
I need to receive a ref from the parent.
How can I solve this?