This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-12-07
Channels
- # adventofcode (114)
- # announcements (3)
- # aws (5)
- # babashka (62)
- # beginners (111)
- # calva (4)
- # cider (20)
- # clara (5)
- # clj-kondo (1)
- # cljs-dev (9)
- # clojure (255)
- # clojure-europe (75)
- # clojure-italy (10)
- # clojure-nl (3)
- # clojure-norway (5)
- # clojure-uk (6)
- # clojuredesign-podcast (5)
- # clojurescript (34)
- # community-development (28)
- # conjure (1)
- # cursive (3)
- # data-science (1)
- # datavis (1)
- # datomic (4)
- # figwheel-main (1)
- # fulcro (14)
- # graalvm (1)
- # graphql (8)
- # integrant (4)
- # introduce-yourself (2)
- # jobs (2)
- # juxt (4)
- # kaocha (2)
- # malli (6)
- # membrane-term (53)
- # mount (2)
- # nextjournal (2)
- # off-topic (27)
- # pathom (11)
- # polylith (3)
- # portal (11)
- # reagent (4)
- # reitit (4)
- # remote-jobs (1)
- # reveal (14)
- # shadow-cljs (22)
- # tools-deps (24)
- # vim (6)
- # xtdb (19)
How do I go about passing a reagent component as a react component?
I tried (r/reactify-component)
and (r/as-element)
but no luck.
Tippy is a react component from an external library
Button is a predefined internal reagent component
[:> Tippy
{:content content
:arrow false}
[Button {:class class :on-click on-click} children]]
What's the JSX code that should work for Tippy
in this case? Assuming Button
is a React component.
Ah.. need to use a ref. I dont know how to do this in cljs either
const ThisWillWork = forwardRef((props, ref) => {
return <button ref={ref}>Reference</button>;
});
function App() {
return (
<Tippy content="Tooltip">
<ThisWillWork />
</Tippy>
);
}
An example of that is available in Reagent's repo: https://github.com/reagent-project/reagent/tree/c214466bbcf099eafdfe28ff7cb91f99670a8433/examples/react-mde