       classList?.remove @props.pendingClass
 
   renderResolved: (value) ->
-    if typeof @props.then is 'string'
-      @renderSimpleLookup value, @props.then.split '.'
+    if typeof @props.children is 'function'
+      @props.children(null, value) ? null
+    else if @props.then?
+      if typeof @props.then is 'string'
+        @renderSimpleLookup value, @props.then.split '.'
+      else
+        @props.then.call this, value
     else
-      @props.then.call this, value
+      null
 
   renderSimpleLookup: (value, path) ->
     until path.length is 0

      @renderRejected @state.error

    else
      # Until the initial promise is resolved or rejected, show the given children.
      @props.children ? null

  componentDidUpdate: (prevProps, prevState) ->
    classList = @getDOMNode()?.classList

    React.createElement @props.tag, @props, value

  renderRejected: (error) ->
    if typeof @props.children is 'function'
      @props.children(error, null) ? null
    if @props.catch?
      @props.catch.call this, error
    else
      null

  defaultThen: (value) ->
    React.createElement @props.tag, @props, value

  defaultCatch: (error) ->
    React.createElement @props.tag, @props, <code className="promise-renderer-error">{error.toString()}</code>
