Regarding passing the props map, are dom generators optimizing for this on their own or only within defsc
?
Corollary question, is there any other reason for using defsc
when defining a stateless component (having only its rendering function) besides prop checking (`shouldComponentUpdate`) ?
Any recommendations on getting rid of this warning?
WARN [com.fulcrologic.fulcro.ui-state-machines:215] - Attempt to get an ASM path [:com.fulcrologic.fulcro.ui-state-machines/local-storage :path-segment] for a state machine that is not in Fulcro state. ASM ID: :app.ui.core/Router
#error {:message "", :data {}}
I am late to the party but I have documented this a while back in the 3rd paragraph of https://gist.github.com/holyjak/da15f613376bf7015385a7cd899ee3e8#gotchas-1
Use app/set-root!
to initialized your app before mounting (and don’t initialize state on mount), then call dr/initialize!
, then mount the app. It’s just a render frame that is showing the app before you’ve started the routing state machines
it’s usually harmless, though
dom generators attempt to use macros to turn exactly into what JSX would emit. Exactly. Same performance and everything even when you use :.x classes and clj props maps (not #js). So, in short: they do exactly what JSX does.
defsc
without a query: The component options map is nice for cases where you want extra stuff to be carried with the class, but otherwise no, the S.C.U lifecycle is the main thing you’re getting there.