hyperstack-org / hyperstack-org/hyperstack

react-create-class message has changed

Open
#259 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
538
Forks
41
PR merge metrics
No merged PRs in 30d

Description

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"
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.