Skip to content

Commit

Permalink
Input 의 useId 를 react 제공 함수로 변경했다
Browse files Browse the repository at this point in the history
  • Loading branch information
healtheloper committed Oct 12, 2023
1 parent 96e96de commit e03a44e
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions packages/co-design-core/src/components/Input/Input.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import React, { forwardRef } from 'react';
import React, { forwardRef, useId } from 'react';
import { useCoTheme, CoComponentProps, CoSize, PolymorphicComponentProps, PolymorphicRef, CoRadius, ClassNames } from '@co-design/styles';
import { View } from '../View';
import useStyles from './Input.style';
import { Text, TextProps } from '../Text';
import { useId } from '@co-design/hooks';

export type InputStylesNames = ClassNames<typeof useStyles>;

Expand Down Expand Up @@ -111,7 +110,7 @@ export const Input: InputComponent & { displayName?: string } = forwardRef(
return (
<Wrapper>
{label && (
<label htmlFor={inputId} className={classes.label}>
<label htmlFor={inputId + name} className={classes.label}>
<Text className={classes.labelText} {...labelTextProps}>
{label}
</Text>
Expand Down Expand Up @@ -139,7 +138,7 @@ export const Input: InputComponent & { displayName?: string } = forwardRef(
required={required}
disabled={disabled}
style={{ paddingRight: rightSection ? rightSectionWidth : theme.spacing.small }}
id={inputId}
id={inputId + name}
/>
{rightSection && (
<div
Expand Down

0 comments on commit e03a44e

Please sign in to comment.