Skip to content
This repository has been archived by the owner on Jul 30, 2018. It is now read-only.

Support returning top level widget, top level arrays and changing top level tag name #737

Merged
merged 8 commits into from
Nov 2, 2017

Conversation

agubler
Copy link
Member

@agubler agubler commented Nov 2, 2017

Type: feature

The following has been addressed in the PR:

  • There is a related issue
  • All code matches the style guide
  • Unit or Functional tests are included in the PR

Description:

This PR addresses support to return a widget directly from a projector, an array of HNodes for append and create and the ability to swap the top level tag name of an Element.

The domNode that is returned by the projection is now not the node for the widget, it is the DOM element created or appended to. Except for merge which returns the DOM element that was the projection was merged on to.

An array is not supported by merge or replace and will throw an error.

Example renders that are now valid for use within a Projector:

// returning a widget at the top level
render() {
    return w(MyWidget, {});
}

// returning an array of HNodes at the top level
render() {
    return [
        v('div', { key: '1' }),
        v('div', { key: '2' }),
        v('div', { key: '3' })
    ];
}

Resolves #731

@agubler agubler requested review from kitsonk and matt-gadd November 2, 2017 14:19
@agubler agubler merged commit 8da4523 into dojo:master Nov 2, 2017
@dylans dylans added this to the beta.4 milestone Jan 10, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants