Fix some React warnings (#10989)
This commit is contained in:
parent
560ec24e58
commit
cc8f6b3cda
2 changed files with 10 additions and 7 deletions
|
@ -33,10 +33,6 @@ const messages = defineMessages({
|
|||
export default @injectIntl
|
||||
class ComposeForm extends ImmutablePureComponent {
|
||||
|
||||
setRef = c => {
|
||||
this.composeForm = c;
|
||||
};
|
||||
|
||||
static contextTypes = {
|
||||
router: PropTypes.object,
|
||||
};
|
||||
|
@ -119,7 +115,9 @@ class ComposeForm extends ImmutablePureComponent {
|
|||
}
|
||||
|
||||
handleFocus = () => {
|
||||
this.composeForm.scrollIntoView();
|
||||
if (this.composeForm) {
|
||||
this.composeForm.scrollIntoView();
|
||||
}
|
||||
}
|
||||
|
||||
componentDidUpdate (prevProps) {
|
||||
|
@ -163,6 +161,10 @@ class ComposeForm extends ImmutablePureComponent {
|
|||
this.spoilerText = c;
|
||||
}
|
||||
|
||||
setRef = c => {
|
||||
this.composeForm = c;
|
||||
};
|
||||
|
||||
handleEmojiPick = (data) => {
|
||||
const { text } = this.props;
|
||||
const position = this.autosuggestTextarea.textarea.selectionStart;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue