Skip to content

Commit

Permalink
refactor(inputtext): use one constant instead of two conditions
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeKESTEMAN committed Jan 17, 2024
1 parent 722d082 commit 7a09308
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions packages/react/src/Form/InputText/TextInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ export const TextInput = ({
disabled = false,
...inputTextProps
}: Props) => {
const inputId = useId();
const inputUseId = useId();
const inputId = id || inputUseId;
const { inputClassModifier, inputFieldClassModifier } = useInputClassModifier(
classModifier,
disabled,
Expand All @@ -42,7 +43,7 @@ export const TextInput = ({
isVisible={isVisible}
forceDisplayMessage={forceDisplayMessage}
className={className}
id={id || inputId}
id={inputId}
classModifier={classModifier}
classNameContainerLabel={classNameContainerLabel}
classNameContainerInput={classNameContainerInput}
Expand All @@ -52,7 +53,7 @@ export const TextInput = ({
classModifier={inputFieldClassModifier}
>
<Text
id={id || inputId}
id={inputId}
classModifier={inputClassModifier}
disabled={disabled}
{...inputTextProps}
Expand Down

0 comments on commit 7a09308

Please sign in to comment.