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) {