           restoring_context fn, arguments
 
       add_renderable: (renderable) ->
-        @renderable_list_builder.add_renderable renderable
+        @add_component component_for_renderable renderable
         ignore
 
       add_component: (component) ->
-        @add_rendering ->
-          wrapper = document.createElement 'div'
-          React.renderComponent component, wrapper
-          wrapper
+        @renderable_list_builder.add_component component
 
       add_rendered: (rendered) ->
         @add_rendering -> rendered
 
-      # adds a function that can render
+      # adds a function that can render.
+      # the function will be called in the current context.
       add_rendering: (rendering) -> @add_renderable _lead_render: @keeping_context(rendering)
 
       render: render

      vars: vars
      imported_vars: imported_vars

  render = (o) ->
    o._lead_render()

  delayed_then_immediate_renderable_list_builder = ->
    $item = $ '<div/>'
    renderables = []
    rendered = false
    add_renderable: (renderable) ->
      if rendered
        $item.append render renderable
      else
        renderables.push renderable
    empty: ->
      renderables.length = 0
      $item.empty()
    _lead_render: ->
      unless rendered
        rendered = true
        children = _.map renderables, render
        $item.append children
      $item

  create_run_context = (extra_contexts) ->
    result_handlers =[

      # creates a nested context, adds it to the renderable list, and applies the function to it
      nested_item: (fn, args...) ->
        nested_context = @create_nested_renderable_context()
        @add_component nested_context.renderable_list_builder
        nested_context.apply_to fn, args

      display_object: (object) ->
