Fork me on GitHub

Hey! My router gets updated, but UI does not. What’s the most “right” way to fix that? I read about it in tutorial, but passing callbacks from root to every place/button seems not right


you can try passing to transact the reconciler instead of component and it will refresh the root, or add a follow-on read.


do you mean (prim/transact! Root {...})?


So you're data isn't changing. Your implication is that your router is a parent of the UI, and the the UI within it didn't change. This means you didn't change the data. Pure rendering. Follow-on reads are the answer for refreshes outside of the tree branch of UI that transacted.


and no, transact on a component class (e.g. Root) isn't what you should ever do. Transact needs a live component. If you wish to run it in response to a child on a parent, use computed props to pass a callback (containing a transact on a parent) through...just like you do in React everywhere.


@U0CKQ19AQ Is it a bad practice to store the reconciler at client start and do routing transaction on it ? Like ?


@U15603AQZ Sory misread, What I meant was not Root, was referring to The central function for running abstract changes in the application. Can be run with a component or reconciler. If run with the reconciler, will typically cause a root re-render.


Of course that's fine, but you should only need that for thing like server push or interval updates.


A router rendering issue should be solved using callbacks to the parent or abstract follow-on reads


Hi. I have a problem with state parameter of defcard-fulcro. When I pass in empty map initial state from components gets properly normalized. When I pass state it does not get normalized. I have tried calling get-initial-state and tree->db on state to denormalize it but it does not work correctly. I would like to have a few cards with different states but I'm not sure how to properly init state.


@nbdam You can initialise state just as you would a normal application, in the started callback.


I would think you would pretty much always leave the initial state as an empty map.


Mostly is sometimes useful to put a (manually normalized) map in there. The way cards work it is already an atom, which causes Fulcro to think that state is already normalized. One use for that is when you have more than one card on the same component and you want to start in different states. In that case, just use tree->db to convert your "tree" to a normalized db.


Hi! I am trying to integrate into my Fulcro app (with shadow-cljs). I have added "google-maps-react" to my package.json but I have a hard time figuring out how to integrate GoogleApiWrapper Higher Order Component (HOC). I must admit I’m not JS expert and I am not sure how I should translate the example provided in the project’s README into Fulcro app - help and any pointers where I could learn more about this would be very appreciated 🙂


I tried the following:

(def ui-google-map (factory-apply Map))
(let [hoc-wrap-fn (GoogleApiWrapper #js {:apiKey "my api key"})
      gmap (ui-google-map #js {....})]
  (hoc-wrap-fn gmap))


you’re passing factory into HOC, but you should pass components themselves


(def ui-google-map
  (let [HOC (GoogleApiWrapper #js {:api "sdfsdf"})
         WrappedComponent (HOC MyMapComponent)]
    (factory-apply WrappedComponent)))


but I’m not 100% sure 😅


That was it - thank you @U15603AQZ


So basically I created a CLJS factory for Map React component, created an instance of that component, created a wrapper instance with my api key and then tried to wrap plain map component with that wrapper fn.


So, when I play with new components, the unfortunate truth is that there are about half a dozen ways npm "libs" are distributed. See the shadow-cljs Users's Guide if you are using that compiler...if you're getting "undefined" errors and such, chances are you just didn't require is correctly.


anyone here use a linter in their fulcro project? thoughts? i’m considering adding it to mine


We use joker, which is pretty nice


looks interesting


is it possible to make it link a directory instead of a file?


and did you set it up with a continuous integration tool?


We have it integrated in our emacs and wrote a small bash script to check recursive directories