Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/Body/BodyRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,8 @@ function BodyRow<RecordType extends { children?: readonly RecordType[] }>(
);
}

BodyRow.displayName = 'BodyRow';
if (process.env.NODE_ENV !== 'production') {
BodyRow.displayName = 'BodyRow';
}

export default responseImmutable(BodyRow);
4 changes: 3 additions & 1 deletion src/Body/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,8 @@ function Body<RecordType>(props: BodyProps<RecordType>) {
);
}

Body.displayName = 'Body';
if (process.env.NODE_ENV !== 'production') {
Body.displayName = 'Body';
}

export default responseImmutable(Body);
4 changes: 3 additions & 1 deletion src/FixedHolder/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,9 @@ const FixedHolder = React.forwardRef<HTMLDivElement, FixedHeaderProps<unknown>>(
);
});

FixedHolder.displayName = 'FixedHolder';
if (process.env.NODE_ENV !== 'production') {
FixedHolder.displayName = 'FixedHolder';
}

/** Return a table in div as fixed element which contains sticky info */
// export default responseImmutable(FixedHolder);
Expand Down
6 changes: 4 additions & 2 deletions src/Header/HeaderRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ function HeaderRow<RecordType>({
flattenColumns,
stickyOffsets,
direction,
column
column,
);

let additionalProps: React.HTMLAttributes<HTMLElement>;
Expand All @@ -81,6 +81,8 @@ function HeaderRow<RecordType>({
);
}

HeaderRow.displayName = 'HeaderRow';
if (process.env.NODE_ENV !== 'production') {
HeaderRow.displayName = 'HeaderRow';
}

export default HeaderRow;
6 changes: 2 additions & 4 deletions src/Table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -877,10 +877,8 @@ function Table<RecordType extends DefaultRecordType>(
}

export type ForwardGenericTable = (<RecordType extends DefaultRecordType = any>(
props: TableProps<RecordType> & { ref?: React.Ref<Reference> },
) => React.ReactElement) & {
displayName?: string;
};
props: TableProps<RecordType> & React.RefAttributes<Reference>,
) => React.ReactElement) & { displayName?: string };

const RefTable = React.forwardRef(Table) as ForwardGenericTable;

Expand Down
6 changes: 2 additions & 4 deletions src/VirtualTable/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,8 @@ function VirtualTable<RecordType>(props: VirtualTableProps<RecordType>, ref: Rea
}

export type ForwardGenericVirtualTable = (<RecordType>(
props: TableProps<RecordType> & { ref?: React.Ref<Reference> },
) => React.ReactElement) & {
displayName?: string;
};
props: TableProps<RecordType> & React.RefAttributes<Reference>,
) => React.ReactElement) & { displayName?: string };

const RefVirtualTable = React.forwardRef(VirtualTable) as ForwardGenericVirtualTable;

Expand Down
5 changes: 4 additions & 1 deletion src/hooks/useRenderTimes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,7 @@ export const RenderBlock = React.memo(() => {
const times = useRenderTimes();
return <h1>Render Times: {times}</h1>;
});
RenderBlock.displayName = 'RenderBlock';

if (process.env.NODE_ENV !== 'production') {
RenderBlock.displayName = 'RenderBlock';
}
2 changes: 1 addition & 1 deletion tests/Virtual.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ describe('Table.Virtual', () => {
});
}

function getTable(props?: Partial<VirtualTableProps<any>> & { ref?: React.Ref<Reference> }) {
function getTable(props?: Partial<VirtualTableProps<any>> & React.RefAttributes<Reference>) {
return render(
<VirtualTable
columns={[
Expand Down