mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-21 02:40:14 +01:00
11 lines
472 B
TypeScript
11 lines
472 B
TypeScript
|
|
import { forwardRef, useLayoutEffect, useState } from 'react';
|
||
|
|
import ReactTextareaAutosize from 'react-textarea-autosize';
|
||
|
|
import type { TextareaAutosizeProps } from 'react-textarea-autosize';
|
||
|
|
export const TextareaAutosize = forwardRef<HTMLTextAreaElement, TextareaAutosizeProps>(
|
||
|
|
(props, ref) => {
|
||
|
|
const [, setIsRerendered] = useState(false);
|
||
|
|
useLayoutEffect(() => setIsRerendered(true), []);
|
||
|
|
return <ReactTextareaAutosize {...props} ref={ref} />;
|
||
|
|
},
|
||
|
|
);
|