fix(trading): avoid funding LineChart recreate instance on FundingContainer re-render (#5454)
This commit is contained in:
parent
3cd393dac0
commit
41cd6b1455
@ -40,6 +40,9 @@ const DateRange = {
|
||||
RANGE_ALL: 'All',
|
||||
};
|
||||
|
||||
const priceFormat = (fundingRate: number) =>
|
||||
`${(fundingRate * 100).toFixed(4)}%`;
|
||||
|
||||
export const FundingContainer = ({ marketId }: { marketId: string }) => {
|
||||
const t = useT();
|
||||
const { theme } = useThemeSwitcher();
|
||||
@ -82,7 +85,7 @@ export const FundingContainer = ({ marketId }: { marketId: string }) => {
|
||||
<LineChart
|
||||
data={values}
|
||||
theme={theme}
|
||||
priceFormat={(fundingRate) => `${(fundingRate * 100).toFixed(4)}%`}
|
||||
priceFormat={priceFormat}
|
||||
yAxisTickFormat="%"
|
||||
/>
|
||||
);
|
||||
|
Loading…
Reference in New Issue
Block a user