hyperstack-org / hyperstack-org/hyperstack

react-create-class message has changed

Aperta
#259 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
JavaScript
Stelle
538
Fork
41
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

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

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.