From d7a4df2fe58908b98f867bfaffd6356eb1007863 Mon Sep 17 00:00:00 2001 From: nikel Date: Tue, 26 Apr 2022 12:23:36 +0300 Subject: [PATCH] fix: Fixed bug with placeholder (#114) --- src/index.tsx | 11 +++++++---- website/App.tsx | 9 +++++++++ 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/src/index.tsx b/src/index.tsx index 71ef8ea9..312cd5b5 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -45,7 +45,10 @@ export default React.forwardRef((p } = props; const [value, setValue] = useState(props.value || ''); - useEffect(() => setValue(props.value || ''), [props.value]); + useEffect( + () => setValue(props.value || ''), + [props.value] + ); const textRef = useRef(null); useImperativeHandle(ref, () => textRef.current!); @@ -59,12 +62,12 @@ export default React.forwardRef((p const htmlStr = useMemo( () => processHtml( - `