Don't pass potentially undefined 'desc' to useId
Also use the useId that comes with React 18.
This commit is contained in:
parent
3cac74df24
commit
d5a5ce9860
1 changed files with 2 additions and 3 deletions
|
@ -14,9 +14,8 @@ See the License for the specific language governing permissions and
|
||||||
limitations under the License.
|
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 classNames from "classnames";
|
||||||
import { useId } from "@react-aria/utils";
|
|
||||||
|
|
||||||
import styles from "./Input.module.css";
|
import styles from "./Input.module.css";
|
||||||
import { ReactComponent as CheckIcon } from "../icons/Check.svg";
|
import { ReactComponent as CheckIcon } from "../icons/Check.svg";
|
||||||
|
@ -97,7 +96,7 @@ export const InputField = forwardRef<
|
||||||
},
|
},
|
||||||
ref
|
ref
|
||||||
) => {
|
) => {
|
||||||
const descriptionId = useId(id + "-desc");
|
const descriptionId = useId();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Field
|
<Field
|
||||||
|
|
Loading…
Add table
Reference in a new issue