# הערך מחדש ווידג'טים בכותרת בעת שינוי נתיב ללא שגיאה

**URL:** <https://meta.discourse.org/t/re-evaluate-widgets-in-header-upon-route-change-without-error/262697>\
**Category:** Development\
**Created:** [24 באפריל,‏ 2023,‏ 11:57am UTC](https://meta.discourse.org/t/re-evaluate-widgets-in-header-upon-route-change-without-error/262697 "2023-04-24T11:57:57Z")\
**Posts on this page:** 1\
**Showing post:** 8

<div class="post-metadata">

**Author:** ![merefield](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/merefield/32/176214_2.png) [@merefield](https://meta.discourse.org/u/merefield)\
**Post date:** [9 במאי,‏ 2023,‏ 8:23pm UTC](https://meta.discourse.org/t/re-evaluate-widgets-in-header-upon-route-change-without-error/262697/8 "2023-05-09T20:23:07Z")

</div>

> [@david](#):
>
> We don’t really want to invest much time here - widgets aren’t going to be around for much longer.

btw, just as a side note here, whilst the widget API is all very bespoke and somewhat fiddly (especially the hyperscript stuff), I must admit it is extremely powerful to attach new behaviour to existing widgets without having to override lots of code.

for example I’ve used this pattern a lot:

```plaintext
api.reopenWidget('discourse-awesome-widget', {

  html(attrs, state) {
    let contents = this._super(...arguments);

    contents.unshift(h("div.my-cool-new-thing", "cool new thing"))

    return contents;
  }
});

```

`this._super` could be a lot of code!!!

And it can get a lot cleverer than that such that I’ve come to really appreciate it.

I hope the “override-abiliy” of whatever replaces it will be as equally flexible and powerful.

---

_[View the full topic](https://meta.discourse.org/t/re-evaluate-widgets-in-header-upon-route-change-without-error/262697)._
