     declarations: ->
       {div, input, label, textarea} = React.DOM
 
-      @state.declarations.map (declaration, index) ->
+      @state.declarations.map (declaration, index) =>
         hiddenField = if 'id' in Object.keys(declaration)
           (input {
             id: "paper_declarations_attributes_#{index}_id"


      (main {}, [
        (h1 {}, @props.taskTitle),
        (RailsForm {action:  "#{@props.paperPath}.json"}, @declarations())])

    submitFormsOnChange: (rootNode) ->
      form = $('form', rootNode)
      Tahi.setupSubmitOnChange form, $('textarea', form)

    componentDidMount: (rootNode) ->
      @submitFormsOnChange rootNode

          (textarea {
            ref: "declaration_answer_#{index}",
            id: "paper_declarations_attributes_#{index}_answer",
            onBlur: @submitForm,
            onChange: @updateContent,
            "data-declaration-index": index,
            name: "paper[declarations_attributes][#{index}][answer]",
            className: 'form-control', rows: 6
            value: declaration['answer']}),
          hiddenField])

    render: ->
