From d5a5ce9860459e6928a96b044a5dc2446db4e47d Mon Sep 17 00:00:00 2001 From: David Baker Date: Mon, 7 Nov 2022 14:05:58 +0000 Subject: [PATCH] Don't pass potentially undefined 'desc' to useId Also use the useId that comes with React 18. --- src/input/Input.tsx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/input/Input.tsx b/src/input/Input.tsx index 738a1511..acec7d3c 100644 --- a/src/input/Input.tsx +++ b/src/input/Input.tsx @@ -14,9 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ -import React, { ChangeEvent, FC, forwardRef, ReactNode } from "react"; +import React, { ChangeEvent, FC, forwardRef, ReactNode, useId } from "react"; import classNames from "classnames"; -import { useId } from "@react-aria/utils"; import styles from "./Input.module.css"; import { ReactComponent as CheckIcon } from "../icons/Check.svg"; @@ -97,7 +96,7 @@ export const InputField = forwardRef< }, ref ) => { - const descriptionId = useId(id + "-desc"); + const descriptionId = useId(); return (