Skip to content

Commit ca2b468

Browse files
authored
Compatible unique id gen (#2916)
1 parent fba0f47 commit ca2b468

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

.changeset/soft-balloons-wink.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"victory-core": patch
3+
---
4+
5+
replace useId for backwards compatibility

packages/victory-core/src/victory-portal/victory-portal.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from "react";
2-
import { defaults } from "lodash";
2+
import { defaults, uniqueId } from "lodash";
33
import * as Log from "../victory-util/log";
44
import * as Helpers from "../victory-util/helpers";
55
import { usePortalContext } from "./portal-context";
@@ -15,7 +15,7 @@ const defaultProps: Partial<VictoryPortalProps> = {
1515

1616
export const VictoryPortal = (initialProps: VictoryPortalProps) => {
1717
const props = { ...defaultProps, ...initialProps };
18-
const id = React.useId();
18+
const id = uniqueId();
1919
const portalContext = usePortalContext();
2020

2121
if (!portalContext) {

0 commit comments

Comments
 (0)