How to pass in a react component into another react component to transclude the first component's content?

Is there a way to pass one component into another react component? I want to create a model react component and pass in another react component in order to transclude that content.

Edit: Here is a reactJS codepen illustrating what I’m trying to do. http://codepen.io/aallbrig/pen/bEhjo

HTML

<div id="my-component">
    <p>Hi!</p>
</div>

ReactJS

/**@jsx React.DOM*/

var BasicTransclusion = React.createClass({
  render: function() {
    // Below 'Added title' should be the child content of <p>Hi!</p>
    return (
      <div>
        <p> Added title </p>
        {this.props.children}
      </div>
    )
  }
});

React.renderComponent(BasicTransclusion(), document.getElementById('my-component'));

76 thoughts on “How to pass in a react component into another react component to transclude the first component's content?”

  1. I think this is one of the so much important info for me.
    And i am satisfied studying your article. However wanna observation on some basic things, The website style is ideal,
    the articles is truly nice : D. Good task, cheers

    Reply
  2. My brother recommended I would possibly
    like this web site. He was entirely right. This put up actually made my day.
    You can not imagine just how a lot time I had spent for
    this information! Thanks!

    Reply
  3. I like the valuable information you provide in your articles.
    I’ll bookmark your weblog and check again here frequently.

    I am quite sure I’ll learn lots of new stuff right here!
    Good luck for the next!

    Reply
  4. Thank you for every other informative website. The place else may I am getting that kind of info written in such a perfect method?
    I’ve a project that I’m simply now operating on,
    and I have been at the look out for such information.

    Reply
  5. Having read this I believed it was rather informative.
    I appreciate you spending some time and energy to
    put this short article together. I once again find myself personally spending a significant amount of time both reading and commenting.
    But so what, it was still worth it!

    Reply
  6. My brother recommended I might like this web site. He was totally right.
    This post truly made my day. You can not imagine just how much time I
    had spent for this information! Thanks!

    Reply
  7. Hi there, You’ve done a fantastic job. I will definitely digg it and personally recommend to my
    friends. I am confident they’ll be benefited from this web site.

    Reply
  8. Thanks for one’s marvelous posting! I seriously
    enjoyed reading it, you are a great author.I will be sure to bookmark your
    blog and will often come back in the foreseeable future.
    I want to encourage that you continue your great posts, have a nice evening!

    Reply
  9. Hello There. I discovered your weblog the usage of msn. This is an extremely smartly written article.
    I will be sure to bookmark it and return to read more of your useful information.
    Thanks for the post. I will definitely comeback.

    Reply
  10. Hi it’s me, I am also visiting this web page on a regular basis, this web page is really pleasant and the people
    are truly sharing good thoughts.

    Reply
  11. I’m not sure exactly why but this web site is loading very slow
    for me. Is anyone else having this issue or is it a problem
    on my end? I’ll check back later on and see if
    the problem still exists.

    Reply
  12. You could definitely see your expertise within the work you write.

    The world hopes for more passionate writers like you
    who aren’t afraid to mention how they believe. All the time follow your heart.

    Reply
  13. Howdy, I do think your web site could possibly be having web
    browser compatibility problems. Whenever I take a look at your site in Safari,
    it looks fine however, if opening in Internet Explorer, it has some overlapping issues.
    I just wanted to give you a quick heads up!

    Other than that, wonderful website!

    Reply
  14. Good way of describing, and fastidious piece of writing to get data
    about my presentation topic, which i am going to present in school.

    Reply
  15. We are a group of volunteers and opening a brand new scheme in our community.

    Your web site offered us with useful info
    to work on. You have done an impressive job
    and our whole community will probably be thankful to you.

    Reply
  16. excellent post, very informative. I’m wondering why
    the other specialists of this sector don’t understand this.
    You should continue your writing. I’m confident, you have a great readers’ base already!

    Reply
  17. Hi! I’ve been following your weblog for a long time now and finally
    got the bravery to go ahead and give you a shout out from Kingwood Tx!
    Just wanted to mention keep up the fantastic work!

    Reply
  18. always i used to read smaller articles or reviews
    which as well clear their motive, and that is also
    happening with this article which I am reading now.

    Reply
  19. This design is spectacular! You most certainly know how to keep a reader amused.
    Between your wit and your videos, I was almost moved to start my own blog (well, almost…HaHa!) Fantastic job.
    I really loved what you had to say, and more than that, how you presented it.
    Too cool!

    Reply
  20. First off I would like to say excellent blog!
    I had a quick question that I’d like to ask if you don’t mind.

    I was curious to know how you center yourself and clear
    your head before writing. I’ve had difficulty clearing my mind in getting my ideas out there.

    I truly do enjoy writing but it just seems like the first 10 to 15 minutes are
    generally wasted simply just trying to figure out how to begin. Any recommendations or tips?
    Appreciate it!

    Reply
  21. hello there and thank you for your info – I’ve certainly picked up something new from right here.
    I did however expertise some technical points using this site, since I experienced to reload the site lots of times previous to I
    could get it to load properly. I had been wondering if your web hosting is OK?
    Not that I am complaining, but slow loading instances times will very frequently affect your placement
    in google and can damage your quality score if
    ads and marketing with Adwords. Well I am adding this RSS
    to my e-mail and could look out for a lot more of your respective intriguing content.
    Make sure you update this again very soon.

    Reply
  22. Hmm it appears like your blog ate my first comment (it was super long) so I guess I’ll just sum it up what I submitted and say,
    I’m thoroughly enjoying your blog. I as well am an aspiring blog blogger but I’m still new to everything.
    Do you have any suggestions for inexperienced blog writers?
    I’d genuinely appreciate it.

    Reply
  23. An intriguing discussion is worth comment. I do think that you need to write more on this
    subject matter, it may not be a taboo subject but generally folks don’t discuss such topics.
    To the next! Kind regards!!

    Reply
  24. Howdy! I could have sworn I’ve visited this web site before but
    after looking at some of the posts I realized it’s new to me.
    Regardless, I’m certainly pleased I came across it and I’ll be bookmarking it and
    checking back frequently!

    Reply
  25. Hi there! I know this is kinda off topic but I was wondering which blog platform are
    you using for this website? I’m getting fed up of WordPress
    because I’ve had problems with hackers and I’m looking
    at alternatives for another platform. I would be awesome if you could point me in the direction of a good platform.

    Reply
  26. Hey There. I found your blog using msn. This is a very
    well written article. I will make sure to bookmark it and come back to
    read more of your useful info. Thanks for the post.
    I will definitely comeback.

    Reply
  27. Hi there! Quick question that’s totally off topic.
    Do you know how to make your site mobile friendly? My weblog looks weird
    when viewing from my iphone4. I’m trying to find a template or plugin that might be able to correct this issue.
    If you have any recommendations, please share. Appreciate it!

    Reply
  28. I think that everything composed made a great deal
    of sense. But, what about this? what if you were to write a killer headline?
    I am not saying your information isn’t good, but suppose you added a post title that makes people want more?
    I mean How to pass in a react component into another react
    component to transclude the first component's content?
    – JavaScript Help is kinda boring. You ought to
    peek at Yahoo’s home page and watch how they write post
    titles to grab viewers to click. You might try adding a video or a
    related pic or two to get readers interested about what you’ve got to say.

    In my opinion, it might make your posts a little livelier.

    Reply
  29. After I originally left a comment I seem to have clicked on the -Notify me when new comments are added- checkbox and from now on each time a comment is
    added I receive four emails with the same comment.
    There has to be an easy method you are able to remove me from
    that service? Kudos!

    Reply
  30. You could certainly see your enthusiasm in the
    article you write. The arena hopes for even more passionate writers like you who
    are not afraid to mention how they believe. At all
    times follow your heart.

    Reply
  31. I’m amazed, I must say. Rarely do I come across a blog that’s equally educative and amusing,
    and without a doubt, you’ve hit the nail on the head.
    The issue is something that not enough folks are speaking intelligently about.
    I’m very happy that I stumbled across this in my hunt for something concerning this.

    Reply