               componentParent.removeComponentChild component
 
             # Remove the reference so that it is clear that template instance is not available anymore.
-            delete @component.templateInstance
+            delete @component._componentInternals.templateInstance
 
       template
 

    while component.mixinParent()
      component = component.mixinParent()

    Blaze.getData(component.templateInstance.view) or null

  # Caller-level data context. Reactive. Use this to get in event handlers the data
  # context at the place where event originated (target context). In template helpers

        onRendered: ->
          # @ is a template instance.
          try
            # Same as for onCreated above.
            @component._componentInternals.inOnRendered = true
            componentOrMixin = null
