Skip to content

Commit

Permalink
Fix rerenders of Coordinates.Cartesian
Browse files Browse the repository at this point in the history
  • Loading branch information
stevenpetryk committed May 8, 2024
1 parent 009c7b8 commit 44411ea
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion e2e/generated-vrt.spec.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// THIS FILE IS GENERATED BY ./scripts/testgen.ts
/* eslint-disable @typescript-eslint/no-explicit-any */
// eslint-disable-next-line @typescript-eslint/no-explicit-any

import { expect, test } from "@playwright/experimental-ct-react"
import { Page } from "@playwright/test"
Expand Down
3 changes: 2 additions & 1 deletion src/display/Coordinates/Cartesian.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import * as React from "react"
import { range, round } from "../../math"
import { usePaneContext } from "../../context/PaneContext"
import { useTransformContext } from "../../context/TransformContext"
Expand Down Expand Up @@ -26,7 +27,7 @@ export function Cartesian({
const xAxis = { subdivisions, ...defaultAxisOptions, ...xAxisOverrides } as GridAxisOptions
const yAxis = { subdivisions, ...defaultAxisOptions, ...yAxisOverrides } as GridAxisOptions

const id = `cartesian-${incrementer++}`
const id = React.useMemo(() => `cartesian-${incrementer++}`, [])

const { viewTransform } = useTransformContext()
const { xPaneRange, yPaneRange } = usePaneContext()
Expand Down

0 comments on commit 44411ea

Please sign in to comment.