This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-04-20
Channels
- # aws (1)
- # beginners (14)
- # boot (30)
- # cider (6)
- # clara (9)
- # cljsjs (3)
- # cljsrn (22)
- # clojure (247)
- # clojure-dusseldorf (75)
- # clojure-france (38)
- # clojure-italy (6)
- # clojure-japan (8)
- # clojure-nl (3)
- # clojure-russia (16)
- # clojure-serbia (4)
- # clojure-spec (1)
- # clojure-uk (53)
- # clojurescript (168)
- # consulting (3)
- # copenhagen-clojurians (1)
- # core-async (7)
- # css (1)
- # datascript (3)
- # datomic (8)
- # dirac (22)
- # events (1)
- # hoplon (2)
- # jobs (1)
- # jobs-discuss (2)
- # leiningen (4)
- # lumo (138)
- # mount (13)
- # nyc (1)
- # off-topic (24)
- # om (34)
- # onyx (15)
- # pedestal (30)
- # re-frame (9)
- # reagent (23)
- # ring (1)
- # ring-swagger (24)
- # rum (6)
- # spacemacs (6)
- # specter (51)
- # uncomplicate (14)
- # unrepl (1)
- # untangled (17)
- # yada (12)
for (uc/get-initial-state TopRouter {}) I get No implementation of method: :initial-state of protocol: #'untangled.client.core/InitialAppState
@claudiu I believe there’s a function get-initial-state
to deal with calling static methods on the server.
@gardnervickers yep. Seem to work for normal components. But for defrouter or components that have defrouter (the macro from https://untangled-web.github.io/untangled/guide.html#!/untangled_devguide.M15_Routing_UI)
Looks like the router uses get-inital-state
, that’s not working for you?
re-writing without the defrouter for now (like in the routing getting started video), since that seems to be the problem as far as I can tell.
Are you sure you’re not calling initial-state
anywhere?
ohh, you’re right. Don’t exactly what I did wrong but seems like if I remove a more complex component it works.
@gardnervickers thank you, all working now. Was calling uc/initial-state Component {}
instead of uc/get-initial-state, strangely enough clojurescript app was working just fine.
@claudiu calling the protocol method directly does work in cljs, but it cannot work on the JVM, which is why we provide the additional funciton
Javascript lets you dynamically change a class in a way that works for that. JVM does not.