       templateBase = componentClassTemplate
       assert templateBase
 
+    try
+      data = Template.currentData()
+    catch error
+      # The exception can be thrown when there is no current view which happens when
+      # there is no data context yet, thus also no arguments were provided through
+      # "args" template helper, so we just continue normally.
+      data = null
+
+    if data?.constructor is argumentsConstructor
+      argumentsProvided = true
+      # Arguments were provided through "args" template helper, use them with the constructor.
+      component = new componentClass data._arguments...
+    else
+      argumentsProvided = false
+      component = new componentClass()
+
     # Create a new component template based on the Blaze template. We want our own template
     # because the same Blaze template could be reused between multiple components.
     # TODO: Should we cache these templates based on (componentName, templateBase) pair? We could use tow levels of ES6 Maps, componentName -> templateBase -> template.

    # We on purpose do not reuse helpers, events, and hooks. Templates are used only for HTML rendering.

    template.onCreated ->
      @view._onViewRendered =>
        # Attach events the first time template instance renders.
        addEvents @view, @component if @view.renderCount is 1

      # @ is a template instance.
      @component = new componentClass()
      @component.templateInstance = @
      @component.onCreated()


  return

Blaze._getComponent = (componentName) ->
  # Blaze.View::lookup should not introduce any reactive dependencies, so we are making sure.
  Tracker.nonreactive =>
    BlazeComponent.getComponent(componentName)?.renderComponent() or null

createUIHooks = (component, parentNode) ->
  insertElement: (node, before) =>
