This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-09-20
Channels
- # aleph (1)
- # announcements (1)
- # aws (11)
- # babashka (117)
- # beginners (34)
- # calva (13)
- # cider (3)
- # clj-commons (8)
- # clj-kondo (24)
- # clj-yaml (36)
- # cljsrn (46)
- # clojure (50)
- # clojure-australia (5)
- # clojure-europe (239)
- # clojure-nl (3)
- # clojure-norway (3)
- # clojure-spec (16)
- # clojurescript (25)
- # core-typed (20)
- # cursive (41)
- # datahike (1)
- # datalevin (1)
- # datomic (17)
- # fulcro (27)
- # hyperfiddle (35)
- # introduce-yourself (1)
- # jobs (4)
- # lsp (20)
- # malli (8)
- # meander (8)
- # nbb (1)
- # off-topic (31)
- # parinfer (9)
- # pathom (3)
- # portal (2)
- # re-frame (20)
- # react (2)
- # reagent (8)
- # releases (1)
- # remote-jobs (4)
- # scittle (2)
- # shadow-cljs (8)
- # slack-help (4)
- # sql (30)
- # squint (3)
- # tools-deps (34)
- # xtdb (21)
Hi, is there any difference in reagent between a ref and forwardRef? I'm struggling to find a direct reference in the docs
Reagent itself does not care about refs. Except when it's an <input>
or a <textarea>
because it wraps such a component internally to preserve the text cursor's state.
But occasionally you might see some issues when interop'ing with React components when you use things like js->clj
and clj->js
because they convert refs as any other JS object. Which, of course, shouldn't be done - refs must stay the same object for them to work properly.
Thank you. I'm just struggling to use a relatively simple react component from npm and am just working through the issues (it's been quite a while since I've used reagent or shadow-cljs). Do I need to name a forwardRef as such or would a ref be used normally?
Not sure what you mean by "naming a forward ref". But if you post some code and the errors that you see maybe I'll be able to tell what's wrong.
sorry, I just mean, in the React code that I'm looking at a forwardRef is defined as such