Fork me on GitHub

Did anyone had React is not defined in fulcro&shadow-cljs project in production build?


@troglotit The book (dev guide) is currently running a production build.


I’m not sure if shadow + CLosure can rename React at this point…if so, then perhaps you’ve got some code that Closure isn’t seeing that isn’t getting the rename? Just guessing wildly here.


thank you, @tony.kay, but I’m afraid I’m facing really weird bug. I tried to reproduce it on clean lein new fulcro - catched it on adding semantic-ui-react, but on trying to validate again on clean lein new fulcro - couldn’t succeed


ah, so it works ok now?


do you mean that when you add semantic-ui-react you hit the problem?


I did hit once. But when tried to validate that - I didn’t catch the bug


I’m sorry I’m not understanding you very well. If you still have a problem, you can post a github repository that demonstrates the problem (with instructions), and perhaps someone can spot the trouble.


I created a repo - the gist is that in watch mode everything works, but in release/production build - I have React is not defined exception. I wasted a lot of time on it, dont know what to do next


omg, it was because of namespaces ordering in :require


that is a strange outcome


which file?


this isn’t right, for example:


you have to actually require react, and not use it via js/ in shadow. Shadow doesn’t use cljsjs stuff.


in root.cljs - I had to put fulcro.client.routing lower than fulcro.client & fulcro.client.dom. I had this idea because sourcemapped stacktrace of exception was in routes.cljc (in fulcro) - it didn’t had any reference to React, so I didn’t even try that at first.


but if you are using shadow-cljs, you should not be referring to js/React, but instead should be requiring it (if you use it) and using it by that name, and shown in the book. Your “fix” worked because by placing DOM first, you got react by proxy (e.g. they require it)…and that was just a lucky break, because those files use the old-style cljsjs requires, which cause the js symbol to be there.


I tried using [“react” :as react], tried commenting that whole declaration - still bug persists. I tried doing that before, and it was just like that.


Hi! I was playing with google-maps-react and I have an issue with HOC (higher order component) that is wrapping my Fulcro component that uses Map component from the library. It looks that props are not passed by Fulcro to my wrapped component. I have a repo with my sample code:


If you take a look at components.cljc ( I have a factory that creates a wrapped component. The issue is that lat and lon props are not passed to MyMap component. Any hints what I am doing wrong?