Fork me on GitHub
#reagent
<
2021-12-07
>
Mitul Shah22:12:12

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]]

p-himik22:12:47

What's the JSX code that should work for Tippy in this case? Assuming Button is a React component.

Mitul Shah22:12:16

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>
  );
}