Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: message input not preventing default on enter on React 16 (#2380)
React 16 had a wacky thing called [event pooling](https://legacy.reactjs.org/docs/legacy-event-pooling.html). Basically you couldn't use event objects outside of the microtask in which the event handler was triggered, unless you explicitly called `event.persist()`. When we made key down handler on message input async in #2332, we broke this rule. So `preventDefault()` in [submit handler](https://github.com/GetStream/stream-chat-react/blob/master/src/components/MessageInput/hooks/useSubmitHandler.ts#L119) became a no-op. React still provides the `perist()` method on synthetic events, even in newer versions, so we just use it to fix the issue.
- Loading branch information