hyperstack-org / hyperstack-org/hyperstack

react-create-class message has changed

未關閉
#259 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
主要語言
JavaScript
星號
538
分支
41
PR 合併指標
30 天內沒有已合併 PR

描述

looks like react fixed a little bug. Used to be you required `'react-create-class'` now its the more expected `'create-react-class'` (and they even give a nice warning if you try to require this.)

Our code also checks and is using the old `react-create-class` in the error message.

```text
--- a/ruby/hyper-component/lib/hyperstack/internal/component/react_wrapper.rb
+++ b/ruby/hyper-component/lib/hyperstack/internal/component/react_wrapper.rb
@@ -64,7 +64,7 @@ module Hyperstack
end

def self.create_native_react_class(type)
- raise "createReactClass is undefined. Add the 'react-create-class' npm module, and import it as 'createReactClass'" if `typeof(createReactClass)=='undefined'`
+ raise "createReactClass is undefined. Add the 'create-react-class' npm module, and import it as 'createReactClass' from 'create-react-class'" if `typeof(createReactClass)=='undefined'`
raise "Provided class should define `render` method" if !(type.method_defined? :render)
render_fn = (type.method_defined? :_render_wrapper) ? :_render_wrapper : :render
# this was hashing type.to_s, not sure why but .to_s does not work as it Foo::Bar::View.to_s just returns "View"
```

貢獻指南

開啟貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。