This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-05-11
Channels
- # announcements (6)
- # babashka (7)
- # beginners (145)
- # biff (2)
- # calva (9)
- # cider (4)
- # circleci (9)
- # clj-commons (22)
- # clj-kondo (26)
- # cljs-dev (70)
- # cljsrn (4)
- # clojure (46)
- # clojure-australia (9)
- # clojure-europe (62)
- # clojure-nl (5)
- # clojure-norway (4)
- # clojure-spec (11)
- # clojure-uk (3)
- # clojurescript (18)
- # copenhagen-clojurians (1)
- # core-async (1)
- # cursive (13)
- # datahike (6)
- # datomic (47)
- # emacs (5)
- # events (2)
- # fulcro (13)
- # google-cloud (2)
- # gratitude (2)
- # helix (5)
- # honeysql (5)
- # hyperfiddle (31)
- # jobs (1)
- # jobs-discuss (6)
- # london-clojurians (1)
- # lsp (5)
- # off-topic (9)
- # polylith (12)
- # portal (18)
- # re-frame (5)
- # reagent (29)
- # releases (2)
- # shadow-cljs (43)
- # specter (1)
- # test-check (8)
- # vim (1)
- # xtdb (66)
can someone explain how to achieve the equivalent of reagent.core/component-path
now that it's been removed (or to otherwise get a "stack trace" of the current component's lifecycle provenance)?
Release notes for 0.10.0 mentioned:
• Removed reagent.core/component-path
. The implementation depended on internal React details and using just Component displayName
achieves nearly the same
but i'm not sure what is meant by "Component displayName
" .
Thanks in advance!
Don't know what you mean by "lifecycle provenance", but to determine a component's name Reagent itself now uses: • https://github.com/reagent-project/reagent/blob/40914d31c397d10ca4e72e27912f8f8c10f3b94a/src/reagent/impl/util.cljs#L50-L62 • https://github.com/reagent-project/reagent/blob/40914d31c397d10ca4e72e27912f8f8c10f3b94a/src/reagent/impl/component.cljs#L102-L113
I see. Nowadays error traces are generated by React itself and AFAIK there's no easy way of getting such a trace by yourself. Maybe React DevTools by itself would be enough for whatever issue you're trying to solve, or maybe its code will help - after all, it builds the whole component tree.
the error traces i'm getting from react aren't sufficient for whatever reason. i'm using reagent + re-frame so there's a lot of indirection there
i found this: https://lilac.town/writing/modern-react-in-cljs-error-boundaries/ which helped somewhat. but it would be nice if it had the stack trace in it
Interesting, I usually don't have such problems. Can you post a minimal reproducible example where the reported error does not indicate where the actual source of the error is?