           {queryTerms.map(function(term, index) {
             return (
               <CwbMultiwordTerm
+                key={this.state.queryTermIds[index]}
                 term={term}
                 termIndex={index}
                 queryHasSingleTerm={this.state.queryTerms.length === 1}

    handleSearch: React.PropTypes.func.isRequired

  getInitialState: ->
    queryTerms: @constructQueryTerms(@props.searchQuery)

  componentWillReceiveProps: (nextProps) ->
    @setState(queryTerms: @constructQueryTerms(nextProps.searchQuery))


  handleKeyDown: (e) ->
    if e.key is 'Enter'

  handleAddTerm: ->
    queryTerms = @state.queryTerms
    queryTerms.push(createTerm())
    queryTermIds = @state.queryTermIds
    queryTermIds.push(lastQueryTermId++)

    @setState(queryTermIds: queryTermIds)
    @props.handleQueryChanged(@constructCQPQuery(queryTerms))


  handleRemoveTerm: (termIndex) ->
    queryTerms = @state.queryTerms
    queryTerms.splice(termIndex, 1)
    queryTermIds = @state.queryTermIds
    queryTermIds.splice(termIndex, 1)

    @setState(queryTermIds: queryTermIds)
    @props.handleQueryChanged(@constructCQPQuery(queryTerms))


