Fork me on GitHub
#helix
<
2022-05-12
>
geraldodev19:05:14

Hi folks, I wanted to understand how helix implements forwardRef as in defnc's doc, but I failed to find a declaration of React.forwardRef. I want to port this component https://github.com/radix-ui/design-system/blob/master/components/Heading.tsx to helix/cljs

lilactown23:05:43

@geraldodev you can just use react/forwardRef

lilactown23:05:04

(ns my-app.feature
  (:require
    ["react" :as react]
    [helix.core :refer [defnc]]))

(defnc my-component
  [props ref]
  {:wrap [(react/forwardRef)]}
  ,,,)

👍 2