# decorateWidget does not return vDom element

**URL:** <https://meta.discourse.org/t/decoratewidget-does-not-return-vdom-element/46680>\
**Category:** Development\
**Created:** [30. Juni 2016 um 20:36 UTC](https://meta.discourse.org/t/decoratewidget-does-not-return-vdom-element/46680 "2016-06-30T20:36:29Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![stevenpslade](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/stevenpslade/32/53550_2.png) [@stevenpslade](https://meta.discourse.org/u/stevenpslade)\
**Post date:** [30. Juni 2016 um 20:44 UTC](https://meta.discourse.org/t/decoratewidget-does-not-return-vdom-element/46680/3 "2016-06-30T20:44:16Z")

</div>

Oh wait ya I just realized that too. I should just use my actual code instead of trying to simplify my problem.

I am doing this:

```
api.decorateWidget('post-meta-data:after', dec => {
  const attrs = dec.attrs;
  function passViews(views) {
    //views is successfully passed to this function from getJSON
    console.log(views);
    //the below vDom test element does NOT attach as expected
    return h('i.fa.fa-eye'));
  }
  $.getJSON(attrs.topicUrl + '.json', function (data) {
    //passing function to success because ultimately I want to
    // get the topic views
    success: passViews(data.views);
  });
});

```

---

_[View the full topic](https://meta.discourse.org/t/decoratewidget-does-not-return-vdom-element/46680)._
