hyperstack-org / hyperstack-org/hyperstack

Reloader applies imports more than once

未关闭
#177 1 条评论 0 个 reaction 已指派 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 摘要。