clojurescript

ClojureScript, a dialect of Clojure that compiles to JavaScript http://clojurescript.org | Currently at 1.10.879
Oz 2021-06-27T10:23:08.031500Z

I wonder what part of the cake I've got wrong: I have a react-grid-layout component, that lives inside a form component, that lives in a fork.cljs component, that takes data from re-frame, based on events that trigger when I navigate to it with reitit. The form is empty when the page loads, but gets populated when I remount(like, navigate to another page and returns, or make a change in the code and shadow-cljs reloads it) After the first remount, the grid elements are there, but there is no layout. But the layout appears after a second remount. I know its hard to tell, but thats a bunch of code to paste, so maybe I can consult your intuition first? Thanks 🙏 :simple_smile:

p-himik 2021-06-27T11:41:46.031600Z

You might be using form-2 or form-3 components and saving state from subscriptions outside of the render function. To get better help, I'd recommend creating a minimal reproducible example that includes all the necessary steps to build and run it. Chances are, you will figure what the problem is while simply trying to create the example - just because you will have to remove a lot of things to make it truly minimal.

👍 1
Oz 2021-06-27T11:49:25.031900Z

Thank you, that's a smart approach, I'll try it!

Jonas 2021-06-27T17:34:38.034600Z

Hey all, I'm trying to compile clojurescript within clojurescript but hitting some issues. I used this snippet (https://github.com/swannodette/cljs-bootstrap)

(js/eval
  (with-out-str
    (c/emit
      (ensure
        (ana/analyze-keyword
          (assoc (ana/empty-env) :context :expr)
          :foo)))))
which works fine, however when I provide a form instead of a keyword using ana/analyse it breaks, e.g.
(js/eval
  (with-out-str
    (c/emit
      (ensure
        (ana/analyze
          (assoc (ana/empty-env) :context :expr)
          '(.log js/console "hello world"))))))
will error with
Error: Cannot read property 'findInternedVar' of null
Is there anything I'm missing here? any other way I should try instead?