Fork me on GitHub
#re-frame
<
2021-10-31
>
DenisMc13:10:42

Thanks for this; so I’m now trying it using your code above:

(defn login-button
      []
      (let [login (.-loginWithRedirect (useAuth0))]
           (println "login = " login)
           [:button {:on-click (fn [] login)}])
      )
And to render I have a minimal piece of code like so:
(defn nav
      []
      [:> login-button]
This is giving me an error saying: Objects are not valid as a React child in my console however; I saw where you said I should use ‘function component syntax’, but I’m not sure what that is, as I can’t see anything that jumps out as being equivalent in the reagent-core documentation at https://reagent-project.github.io/docs/master/reagent.core.html. Thanks again for your help.

p-himik14:10:46

Use :f> instead of :>.

DenisMc14:10:32

I tried that, when I try it I get Assert failed: Invalid tag: '' (in > > > app.nav.views.nav.nav) in my console. Do I need an extra dependency or something I wonder?

p-himik14:10:15

Reagent documentation is not great when it comes to that website, but :f> is documented in its repo somwhere. No clue about that error though.

DenisMc14:10:22

Ya, I figured the error was to do with the :f> not being recognised, as I messed around with other clearly incorrect tags such as :foo> for example and got the same error.

p-himik14:10:44

Then you're using some old version of Reagent.

DenisMc14:10:53

I am actually, I’m using 0.8.1 (I’m basing my app on Jacek Schae’s courses which I’ve found very useful, but the versions are a bit behind). I’ll try updating to 1.1.0 and see how I get on :thumbsup:

DenisMc20:10:22

Thanks for the help @p-himik/@alex395 that’s working now. Once I updated and fixed a couple of typos here and there it started to work.

👍 1