Skip to content

Commit

Permalink
Wrap Table component with BrowserRouter for enhanced routing capabili…
Browse files Browse the repository at this point in the history
…ties
  • Loading branch information
hervedombya committed Jan 17, 2025
1 parent 14bc32b commit 62c276f
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions src/lib/components/tablev2/Tablev2.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import { TableWrapper, TooltipContent } from './Tablestyle';
import { compareHealth, TableHeightKeyType } from './TableUtils';
import { useCheckbox } from './useCheckbox';
import { Icon } from '../icon/Icon.component';
import { BrowserRouter } from 'react-router-dom';

type UpdateTableData<
DATA_ROW extends Record<string, unknown> = Record<string, unknown>,
Expand Down Expand Up @@ -156,8 +157,8 @@ const DefaultRenderer = ({ value }) => {
rowHeight === 'h32'
? 1
: rowHeight === 'h40' || rowHeight === 'h48'
? 2
: 3;
? 2
: 3;
return (
<Box mr={4}>
<ConstrainedText text={value} lineClamp={lineClamp} />
Expand Down Expand Up @@ -326,14 +327,16 @@ function Table<
hasScrollbar,
};
return (
<TableContext.Provider
//@ts-ignore
value={contextValue}
>
<TableWrapper role="grid" className="table">
{children}
</TableWrapper>
</TableContext.Provider>
<BrowserRouter>
<TableContext.Provider
//@ts-ignore
value={contextValue}
>
<TableWrapper role="grid" className="table">
{children}
</TableWrapper>
</TableContext.Provider>
</BrowserRouter>
);
}

Expand Down

0 comments on commit 62c276f

Please sign in to comment.