Skip to content

Commit

Permalink
Merge pull request #6 from elenitaex5:hf/min-height
Browse files Browse the repository at this point in the history
fix: saving min height if is included in style props
  • Loading branch information
elenitaex5 authored Oct 24, 2023
2 parents c610f47 + c457e2e commit f88974c
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 f88974c

Please sign in to comment.