This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-09-11
Channels
not sure the time Chrome turn on it for all websites. I think that would affect quite some sites.
Chrome Canary has this issue. Although it affects on cookies mostly. Just feel quite annoying
Hey guys! May you can help me... I'm not able to got a React component working with Shadow-cljs... I think it may something with the way I need to import... On the samples, the import is made that way:
import * as WebDataRocksReact from './webdatarocks.react';
The package, on NPM, is just "webdatarocks".
I did the import this way:
["webdatarocks" :as wdr]
But when I try to use this component, I get an error "Warning: React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for"...
In the component's doc, I should do
<WebDataRocksReact.Pivot />
In clojurescript I can't figure out how to instantiate... I've tried thinks like
[:> wdr/Pivot {}]
or
[:> wdr/WebDataRocksReact {}]
None works...I think this "." (dot) in import as well on component name is what troubles me...
@gleisonsilva try shadow-cljs browser-repl
and then (require '["webdatarocks" :as wdr])
+ (js/console.dir wdr)
Hey @thheller, there isn't...
the docs don't tell that https://www.webdatarocks.com/doc/integration-with-react/ https://github.com/WebDataRocks/pivot-react/blob/master/src/App.js
Do you have some suggestion on how can I instantiate it?
you need this file also https://github.com/WebDataRocks/pivot-react/blob/master/src/webdatarocks.react.js
componentDidMount() {
var config = {};
config.container = ReactDOM.findDOMNode(this);
this.parseProps(config);
this.webdatarocks = new window.WebDataRocks(config);
}
Right. I'll try! Thk u very much!
@thheller looking through the code, I can see that the webdatarocks.js has the react parts
There is a way to import like in the example, like "webdatarocks.react"??
import * as WebDataRocksReact from './webdatarocks.react';
is just importing ./webdatarocks.react.js
relative to the App.js
you can maybe access js/WebDataRocksReact
if there is a global js/React
(which there normally isn't)
Got it. I'll try the other way so...