Skip to content

Commit

Permalink
Remove unused inputRef from TextArea
Browse files Browse the repository at this point in the history
Additionally it was assigned to a styled component which would need a forwardRef instead.
  • Loading branch information
terolaakso committed Oct 3, 2024
1 parent bd4c1c7 commit 117bc0c
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions frontend/src/lib-components/atoms/form/TextArea.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import autosize from 'autosize'
import classNames from 'classnames'
import React, { RefObject, useEffect, useMemo, useRef, useState } from 'react'
import React, { useEffect, useMemo, useRef, useState } from 'react'
import styled from 'styled-components'

import { BoundFormState } from 'lib-common/form/hooks'
Expand Down Expand Up @@ -34,7 +34,6 @@ interface TextAreaInputProps extends BaseProps {
'aria-describedby'?: string
hideErrorsBeforeTouched?: boolean
required?: boolean
inputRef?: RefObject<HTMLTextAreaElement>
wrapperClassName?: string
}

Expand All @@ -56,8 +55,7 @@ const TextArea = React.memo(function TextArea({
className,
'aria-describedby': ariaId,
hideErrorsBeforeTouched,
required,
inputRef
required
}: TextAreaInputProps) {
const [touched, setTouched] = useState(false)

Expand Down Expand Up @@ -97,7 +95,6 @@ const TextArea = React.memo(function TextArea({
id={id}
aria-describedby={ariaId}
required={required ?? false}
ref={inputRef}
rows={rows}
/>
{!!infoText && (
Expand Down

0 comments on commit 117bc0c

Please sign in to comment.