Fork me on GitHub

Hi! What is the syntax for passing another component into another component as a named prop?


I have a React component expecting another React component handed to it in a prop named "trigger". What might be worth mentioning is that both components are pure JS-components acquired by inter-op. Using them with the [:> <component> {:prop-name <prop-value>}]-syntax works fine, as long as the props are strings and other basic types.


@torkan take a look at the example in this readme, which passes a component to a trigger prop:


It wraps the component with (reagent/as-element ...)


Not sure if that is what you'll need, but worth a try


Considering it is semantic I'm trying to get started with, I think it's as dead on as it gets 😊 Thanks!


@gadfly361 Checked it out now, worked as a charm!


@gadfly361: Have you tried the Popup-component? It doesn't seem to adhere to the position prop, the internal state is not updated as when doing it in JS


I am struggling with React's css transition group & reagent. I have a simple page switcher:

(def CSSTransitionGroup
  (reagent/adapt-react-class js/React.addons.CSSTransitionGroup))

 [:button {:on-click #(swap! question-id inc)} "next page"]
 [CSSTransitionGroup {:transition-name        "pageChange"
                      :transitionEnterTimeout 500
                      :transitionLeaveTimeout 300}
  [:div {:key @question-id}
   (get pages @question-id)]]]
When I click the button, I get Uncaught TypeError: Cannot read property 'findDOMNode' of null. From line 593 in which looks like this:
var node = ReactAddonsDOMDependencies.getReactDOM().findDOMNode(this);
If I remove the CSSTransitionGroup my pages will switch correctly. Has anyone encountered this issue before?


@kenny I think it is the version of react you are using, see this issue:


@torkan, i haven't tried the popup-component. If i have some time, i'll try and ping you if i come up with anything helpful


@gadfly361 Yup, that sure sounds like my problem. Is this a bug in Reagent then?


I'm not sure, I haven't explored it yet (still on a previous version of react, so havent felt enough pain to spur me into research) .. but it is something that is nice to track, even if the problem is upstream


Yup, I was also able to confirm it works on 15.4.1-0 and not on 15.4.2-2.