Browse Source

ref(ts): Another minor adjusment for react 17 (#25615)

Evan Purkhiser 3 years ago
parent
commit
38105083af
1 changed files with 3 additions and 3 deletions
  1. 3 3
      static/app/components/activity/note/input.tsx

+ 3 - 3
static/app/components/activity/note/input.tsx

@@ -1,5 +1,5 @@
 import React from 'react';
-import {Mention, MentionsInput} from 'react-mentions';
+import {Mention, MentionsInput, MentionsInputProps} from 'react-mentions';
 import {withTheme} from '@emotion/react';
 import styled from '@emotion/styled';
 
@@ -122,7 +122,7 @@ class NoteInputComponent extends React.Component<Props, State> {
     this.submitForm();
   };
 
-  handleChange = (e: MentionChangeEvent) => {
+  handleChange: MentionsInputProps['onChange'] = e => {
     this.setState({value: e.target.value});
 
     if (this.props.onChange) {
@@ -130,7 +130,7 @@ class NoteInputComponent extends React.Component<Props, State> {
     }
   };
 
-  handleKeyDown = (e: React.KeyboardEvent<HTMLTextAreaElement | HTMLInputElement>) => {
+  handleKeyDown: MentionsInputProps['onKeyDown'] = e => {
     // Auto submit the form on [meta] + Enter
     if (e.key === 'Enter' && (e.metaKey || e.ctrlKey)) {
       this.submitForm();