Skip to content

Commit d35502f

Browse files
docs: added descriptive comment for resetInput call
1 parent aeeaaf5 commit d35502f

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/components/MessageInput/MessageInput.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -336,6 +336,12 @@ export const MessageInputWithContext = <
336336

337337
/**
338338
* Make sure to test `initialValue` functionality, if you are modifying following condition.
339+
*
340+
* We have the following condition, to make sure - when user comes out of "editing message" state,
341+
* we wipe out all the state around message input such as text, mentioned users, image uploads etc.
342+
* But it also means, this condition will be fired up on first render, which may result in clearing
343+
* the initial value set on input box, through the prop - `initialValue`.
344+
* This prop generally gets used for the case of draft message functionality.
339345
*/
340346
if (
341347
!editing &&

0 commit comments

Comments
 (0)