Skip to content

Commit

Permalink
feat(tooltip): add a display name to memoized components to ease testing
Browse files Browse the repository at this point in the history
  • Loading branch information
plouc committed Nov 15, 2020
1 parent 0a54e62 commit 218e237
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/tooltip/src/Crosshair.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,5 @@ export const Crosshair = memo(({ width, height, type, x, y }: CrosshairProps) =>
</>
)
})

Crosshair.displayName = 'Crosshair'
2 changes: 2 additions & 0 deletions packages/tooltip/src/CrosshairLine.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,5 @@ export const CrosshairLine = memo(({ x0, x1, y0, y1 }: CrosshairLineProps) => {

return <animated.line {...animatedProps} fill="none" style={style} />
})

CrosshairLine.displayName = 'CrosshairLine'
2 changes: 2 additions & 0 deletions packages/tooltip/src/TableTooltip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,5 @@ export const TableTooltip = memo(({ title, rows = [], renderContent }: TableTool

return <div style={theme.tooltip.container}>{content}</div>
})

TableTooltip.displayName = 'TableTooltip'
2 changes: 2 additions & 0 deletions packages/tooltip/src/TooltipWrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,3 +83,5 @@ export const TooltipWrapper = memo<PropsWithChildren<TooltipWrapperProps>>(
)
}
)

TooltipWrapper.displayName = 'TooltipWrapper'

0 comments on commit 218e237

Please sign in to comment.