Skip to content

Commit

Permalink
fix: saving min height if is included in style props
Browse files Browse the repository at this point in the history
  • Loading branch information
elenitaex5 committed Oct 24, 2023
1 parent c610f47 commit c457e2e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/components/TextAreaResizable/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,11 @@ export const TextAreaResizable = (props: TextAreaResizableProps) => {
}

useEffect(() => {
//@ts-ignore

Check failure on line 65 in src/components/TextAreaResizable/index.tsx

View workflow job for this annotation

GitHub Actions / lint

Expected space or tab after '//' in comment
if (props.style?.minHeight && props.style.minHeight > rows * TEXTAREA_LINE_HEIGHT) {
return setMinHeight(props.style.minHeight)
}

setMinHeight(rows * TEXTAREA_LINE_HEIGHT)
}, [rows])

Check warning on line 71 in src/components/TextAreaResizable/index.tsx

View workflow job for this annotation

GitHub Actions / lint

React Hook useEffect has a missing dependency: 'props.style.minHeight'. Either include it or remove the dependency array. If 'setMinHeight' needs the current value of 'props.style.minHeight', you can also switch to useReducer instead of useState and read 'props.style.minHeight' in the reducer

Expand Down

0 comments on commit c457e2e

Please sign in to comment.