[Glitch] Fix some React warnings
Port cc8f6b3cdaca81be99875c27002e0280d1d88191 to glitch-soc Signed-off-by: Thibaut Girka <thib@sitedethib.com>
This commit is contained in:
		
							parent
							
								
									3485acefed
								
							
						
					
					
						commit
						362f3973be
					
				@ -201,7 +201,7 @@ export default class AutosuggestTextarea extends ImmutablePureComponent {
 | 
				
			|||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    return [
 | 
					    return [
 | 
				
			||||||
      <div className='compose-form__autosuggest-wrapper'>
 | 
					      <div className='compose-form__autosuggest-wrapper' key='autosuggest-wrapper'>
 | 
				
			||||||
        <div className='autosuggest-textarea'>
 | 
					        <div className='autosuggest-textarea'>
 | 
				
			||||||
          <label>
 | 
					          <label>
 | 
				
			||||||
            <span style={{ display: 'none' }}>{placeholder}</span>
 | 
					            <span style={{ display: 'none' }}>{placeholder}</span>
 | 
				
			||||||
@ -226,7 +226,8 @@ export default class AutosuggestTextarea extends ImmutablePureComponent {
 | 
				
			|||||||
        </div>
 | 
					        </div>
 | 
				
			||||||
        {children}
 | 
					        {children}
 | 
				
			||||||
      </div>,
 | 
					      </div>,
 | 
				
			||||||
      <div className='autosuggest-textarea__suggestions-wrapper'>
 | 
					
 | 
				
			||||||
 | 
					      <div className='autosuggest-textarea__suggestions-wrapper' key='suggestions-wrapper'>
 | 
				
			||||||
        <div className={`autosuggest-textarea__suggestions ${suggestionsHidden || suggestions.isEmpty() ? '' : 'autosuggest-textarea__suggestions--visible'}`}>
 | 
					        <div className={`autosuggest-textarea__suggestions ${suggestionsHidden || suggestions.isEmpty() ? '' : 'autosuggest-textarea__suggestions--visible'}`}>
 | 
				
			||||||
          {suggestions.map(this.renderSuggestion)}
 | 
					          {suggestions.map(this.renderSuggestion)}
 | 
				
			||||||
        </div>
 | 
					        </div>
 | 
				
			||||||
 | 
				
			|||||||
@ -28,10 +28,6 @@ const messages = defineMessages({
 | 
				
			|||||||
export default @injectIntl
 | 
					export default @injectIntl
 | 
				
			||||||
class ComposeForm extends ImmutablePureComponent {
 | 
					class ComposeForm extends ImmutablePureComponent {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  setRef = c => {
 | 
					 | 
				
			||||||
    this.composeForm = c;
 | 
					 | 
				
			||||||
  };
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  static contextTypes = {
 | 
					  static contextTypes = {
 | 
				
			||||||
    router: PropTypes.object,
 | 
					    router: PropTypes.object,
 | 
				
			||||||
  };
 | 
					  };
 | 
				
			||||||
@ -145,6 +141,10 @@ class ComposeForm extends ImmutablePureComponent {
 | 
				
			|||||||
    }
 | 
					    }
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  setRef = c => {
 | 
				
			||||||
 | 
					    this.composeForm = c;
 | 
				
			||||||
 | 
					  };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  //  Inserts an emoji at the caret.
 | 
					  //  Inserts an emoji at the caret.
 | 
				
			||||||
  handleEmoji = (data) => {
 | 
					  handleEmoji = (data) => {
 | 
				
			||||||
    const { textarea: { selectionStart } } = this;
 | 
					    const { textarea: { selectionStart } } = this;
 | 
				
			||||||
@ -213,8 +213,10 @@ class ComposeForm extends ImmutablePureComponent {
 | 
				
			|||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  handleFocus = () => {
 | 
					  handleFocus = () => {
 | 
				
			||||||
 | 
					    if (this.composeForm) {
 | 
				
			||||||
      this.composeForm.scrollIntoView();
 | 
					      this.composeForm.scrollIntoView();
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  //  This statement does several things:
 | 
					  //  This statement does several things:
 | 
				
			||||||
  //  - If we're beginning a reply, and,
 | 
					  //  - If we're beginning a reply, and,
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user