This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-09-08
Channels
- # announcements (32)
- # aws (2)
- # babashka (21)
- # beginners (143)
- # cider (3)
- # cljsrn (13)
- # clojure (65)
- # clojure-dev (7)
- # clojure-europe (20)
- # clojure-losangeles (8)
- # clojure-nl (13)
- # clojure-norway (39)
- # clojure-uk (9)
- # clojurescript (39)
- # code-reviews (10)
- # conjure (2)
- # cursive (3)
- # datascript (6)
- # datomic (40)
- # events (5)
- # exercism (23)
- # fulcro (9)
- # funcool (2)
- # girouette (2)
- # graphql (4)
- # helix (8)
- # improve-getting-started (4)
- # integrant (7)
- # introduce-yourself (5)
- # jobs (3)
- # luminus (32)
- # malli (3)
- # off-topic (10)
- # pathom (9)
- # pedestal (4)
- # polylith (25)
- # practicalli (1)
- # re-frame (4)
- # sci (3)
- # shadow-cljs (5)
- # tools-deps (25)
- # vim (31)
- # xtdb (32)
Hiya 👋 We've been working on a prototype at work that uses Helix, shadow-cljs and AWS Amplify (amongst other things). I'm now looking to customise the Amplify authentication form, similar to what's being done here https://docs.amplify.aws/lib/auth/customui/q/platform/js/#customize-withauthenticator-hoc. That example is using a class that extends the Amplify SignIn
class. I was wondering if Helix supported class extension for components in some way? I found some discussion from about a year ago around defclass
, but I'm not sure if that culminated in something officially supported or not. Any help here would be massively appreciated
P.S. Thank you @lilactown for creating Helix. It's been great to work with so far 💯
yeah helix won't help you with that right now. there's a defcomponent
macro that essentially does class component extends React.Component
but helix doesn't have a macro or other mechanism for extending arbitrary classes
if you're using shadow-cljs you can try using shadow.cljs.modern
: https://clojureverse.org/t/modern-js-with-cljs-class-and-template-literals/7450
the other option is you could write that component in JS and include it in your source and then use it with helix. i.e. SignIn.js
// This is my custom Sign in component
export class MySignIn extends SignIn {
render() {
...
}
}
app.cljs
(ns
(:require
["./SignIn.js" :as sign-in]
["aws-amplify-react" :as amplify]
[helix.core :refer [defnc $]]))
(defnc app
[]
,,,)
(amplify/withAuthenticator
app false
($ sign-in/MySignIn)
($ amplify/ConfirmSignIn)
($ amplify/VerifyContact)
($ amplify/SignUp)
($ amplify/ConfirmSignUp)
($ amplify/ForgotPassword)
($ amplify/RequireNewPassword))
hope that helps @yogidevbear
Brilliant, thanks @lilactown 👍 I'll try that route tomorrow