Fork me on GitHub
#fulcro
<
2021-02-19
>
tvaughan16:02:38

Does the current-route! function mentioned at https://book.fulcrologic.com/#_route_segments_and_changing_routes exist? I don't see it in a github search. Thanks

tony.kay18:02:22

Use the source. Double-tap of shift in IntelliJ, type current-route, double tap shift again to get “include non-project items”:

tony.kay18:02:43

Or just jump to source from a require of the DR ns Or clone the repo and try git grep Or use https://cljdoc.org/d/com.fulcrologic/fulcro/3.4.17/api/com.fulcrologic.fulcro.routing.dynamic-routing (thanks to @U0522TWDA!!! So nice)

tvaughan18:02:43

Thanks @U0CKQ19AQ However, I'm asking about:

Additional useful functions are:

(current-route! component-or-app starting-component)
Returns a vector of the path components on the current (live) route starting at the given starting-component. If you use your root component it will be the absolute path, and using some other component router will give the relative path from there.

tvaughan18:02:12

Note the trailing !

tony.kay18:02:28

yes, that doc is incorrect

👍 1
hadils17:02:27

I have a n00b question. I am working on Fulcro with React Native. I have the app rendering properly and am able to see controls.. I am successfully loading queries in to my local app db -- I can seee the data with Fulcro inspect. However, the forms on the simulator are blank and my debugging statements show that props are empty. I am sure that i missed something or am doing something wrong. Could someone point me in the right direction? Thanks in advance!

tony.kay18:02:05

You have to join the loaded data to your view graph. Initial data composes it all together for what is there at app startup, but if you’re loading data you use targeting to create the edge in the UI. If props are nil, here is the way to diagnose it every time: 1. Go to DB Explorer tab in Inspec 2. Find your root data node 3. Follow the graph by clicking to follow your data graph in the same way your UI joins the target in…root through router current route through X , Y, etc. At some point you will either: Discover that your data graph isn’t connected and that you should have added :`target` to your load or merge, OR discover that you didn’t compose the query to match your data graph.

hadils18:02:21

Thank you @U0CKQ19AQ. I'm sorry to bother you.

tony.kay18:02:48

no problem. Everyone asks this same question at some point, and it’s funny how silly simple the answer always is: Fulcro is the only lib I’m aware of where the View = F(state) in such a literal way. If the F, which is just the query, can follow the graph in state, which it does literally by walking idents, then you’ll get the right props. The one additional screw-up is if you don’t pull the props out and pass them to the child. That’s also a possible thing to look at, but much rarer mistake since the defsc macro tries to error-check your destructuring of props for typos (because it was a common error that we could detect and help with)

Aleksander Rendtslev02:02:54

Hi @UGNMGFJG3 , I'm also in the process of building a React Native app with Fulcro, and I've been through a lot of the same gotchas (where Tony helped me out). Let me know if you'd like to jump on a call and compare notes? I'd be happy to show you what I've gotten so far.

hadils03:02:37

Hi @U01DH13SK8E -- let's compare notes soon. I have made some progress and would like to find someone to talk to about where I am headed.

holyjak21:02:55

Thanks to my awesome mentees, I am starting a new series, "Fulcro Gotchas". The beginning is here: https://gist.github.com/holyjak/5bad02dc378fe57b3111edab42b4adbc If you have some pitfalls and misconceptions of your own that you would like help others to avoid, let me know!

❤️ 3
aratare06:02:42

Note to self: Definitely don't mistake ident for indent 😄

😱 1
holyjak13:02:46

Thank you, Tony! Updated.