From ca2b468d361671daace2742aa0a0dee8375794f4 Mon Sep 17 00:00:00 2001 From: Nathan Kluth Date: Mon, 14 Oct 2024 13:24:59 -0600 Subject: [PATCH] Compatible unique id gen (#2916) --- .changeset/soft-balloons-wink.md | 5 +++++ packages/victory-core/src/victory-portal/victory-portal.tsx | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 .changeset/soft-balloons-wink.md diff --git a/.changeset/soft-balloons-wink.md b/.changeset/soft-balloons-wink.md new file mode 100644 index 000000000..e959915bb --- /dev/null +++ b/.changeset/soft-balloons-wink.md @@ -0,0 +1,5 @@ +--- +"victory-core": patch +--- + +replace useId for backwards compatibility diff --git a/packages/victory-core/src/victory-portal/victory-portal.tsx b/packages/victory-core/src/victory-portal/victory-portal.tsx index 93bb4d9e3..e419b1d6d 100644 --- a/packages/victory-core/src/victory-portal/victory-portal.tsx +++ b/packages/victory-core/src/victory-portal/victory-portal.tsx @@ -1,5 +1,5 @@ import React from "react"; -import { defaults } from "lodash"; +import { defaults, uniqueId } from "lodash"; import * as Log from "../victory-util/log"; import * as Helpers from "../victory-util/helpers"; import { usePortalContext } from "./portal-context"; @@ -15,7 +15,7 @@ const defaultProps: Partial = { export const VictoryPortal = (initialProps: VictoryPortalProps) => { const props = { ...defaultProps, ...initialProps }; - const id = React.useId(); + const id = uniqueId(); const portalContext = usePortalContext(); if (!portalContext) {