   # provided, it returns only the value under that path, with reactivity
   # limited to changes of that value only.
   data: (path, equalsFunc) ->
-    @_componentInternals ?= {}
-    @_componentInternals.templateInstance ?= new ReactiveField null, (a, b) -> a is b
-
-    if view = @_componentInternals.templateInstance()?.view
+    component = @component()
+
+    component._componentInternals ?= {}
+    component._componentInternals.templateInstance ?= new ReactiveField null, (a, b) -> a is b
+
+    if view = component._componentInternals.templateInstance()?.view
       if path?
         return DataLookup.get =>
           Blaze.getData view

      # Maybe mixin has its own mixins as well.
      mixinInstance.createMixins?()

      @_componentInternals.templateInstance ?= new ReactiveField null, (a, b) -> a is b

      # If a mixin is adding a dependency using requireMixin after its mixinParent class (for example, in onCreate)
      # and this is this dependency mixin, the view might already be created or rendered and callbacks were
      # already called, so we should call them manually here as well. But only if he view has not been destroyed
      # already. For those mixins we do not call anything, there is little use for them now.
      unless @_componentInternals.templateInstance()?.view.isDestroyed
        mixinInstance.onCreated?() if not @_componentInternals.inOnCreated and @_componentInternals.templateInstance()?.view.isCreated
        mixinInstance.onRendered?() if not @_componentInternals.inOnRendered and @_componentInternals.templateInstance()?.view.isRendered

    # To allow chaining.
    @


  # Maybe a preexisting template helper on the component's base template.
  if component
    # We know that component is really a component.
    if (helper = component._componentInternals?.templateBase?.__helpers.get name)?
      return wrapHelper bindDataContext(helper), templateInstance

