With cljsjs/fixed-data-table
in devcards it works fine. But in my main app the fixed-data-table code throws an error because ReactDOM
is undefined, even though ReactDOM
is available as a global var in the js console.
Does devcards
do anything special to make sure ReactDOM
is defined in cljsjs packages?
The only thing I saw in the source was this. https://github.com/bhauman/devcards/blob/c463b5d9e675063e8288b20ceff253ad0289d3f2/src%2Fdevcards%2Fsystem.cljs#L12 I copied that but it didn't work.
@currentoor: You probably are not requiring ReactDOM before its first use.
You have to require cljsjs.react and cljsjs.reactdom.
@bhauman: I'll try adding those two the to top of my :require
statements.
If you have to level code that is executing on file load you need to make sure that the require happens before that code executes
"Top level"
I would go to your root file and require it there. And then look at the Dom and see what order things are loading
Good idea, I'll try that. Thanks!
@bhauman: it works now, Thank you very much!