hyperstack-org / hyperstack-org/hyperstack

Reloader applies imports more than once

オープン
#177 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る
enhancement
主要言語
JavaScript
スター
538
フォーク
41
PR マージ指標
30日以内にマージされた PR はありません

説明

I have the following method in my `HyperComponent.rb`

```ruby
def self.decorate(decorator)
imports `decorator(#{self.to_n})`
end
```

```ruby
class AccountForm < HyperComponent
decorate `Mui.withStyles(styles, { withTheme: true })`

# snip
end
```

I use this inside of components to deceore them with higher order components. Whenever the reloader reloads the component, it applies the import again, resulting in very large trees.

First render:
![image](https://user-images.githubusercontent.com/1729810/56667453-373d6f00-6684-11e9-9169-c37e164c4c96.png)

After 10 reloads:
![image](https://user-images.githubusercontent.com/1729810/56667539-648a1d00-6684-11e9-9993-72fe2790becf.png)

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。