Don't pass potentially undefined 'desc' to useId

Also use the useId that comes with React 18.
This commit is contained in:
David Baker 2022-11-07 14:05:58 +00:00
parent 3cac74df24
commit d5a5ce9860

View file

@ -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 (
<Field