We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 40bd3cc commit 53c5285Copy full SHA for 53c5285
package/src/components/MessageInput/InputButtons.tsx
@@ -50,13 +50,11 @@ export const InputButtonsWithContext = (props: InputButtonsWithContextProps) =>
50
const { command } = useStateStore(customDataManager.state, customComposerDataSelector);
51
const [showMoreOptions, setShowMoreOptions] = useState(true);
52
53
+ const hasText = !!text;
54
+
55
useEffect(() => {
- if (text.length > 0) {
- setShowMoreOptions(false);
56
- } else {
57
- setShowMoreOptions(true);
58
- }
59
- }, [text]);
+ setShowMoreOptions(!hasText);
+ }, [hasText]);
60
61
const {
62
theme: {
0 commit comments