   getInitialState: ->
     attributes        : if @props.storage then do @storage else @props.attributes
 
+  # -- Lifecycle
+  componentWillReceiveProps: (next_props) ->
+    @setValue next_props.attributes if next_props.attributes
+
   # -- Events
   onSubmit: (event) ->
     event.preventDefault()

  onChange: (event) ->
    is_valid = true
    value = @getValue()
    for attr in @props.attributes when attr.required and value[attr.ref]?.trim() is ""
      is_valid = false
      @refs[attr.ref].setError? "Required field"
      break

@todo
###

require "./style"
Autocomplete  = require "../autocomplete"
Button        = require "../button"
Input         = require "../input"
