Fork me on GitHub
#clojurescript
<
2021-06-27
>
Oz10:06:08

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-himik11:06:46

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.

👍 3
Oz11:06:25

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

Jonas17:06:38

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?