Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript React Basics (retired) First Steps in React Our First Application

Alex Busu
Alex Busu
Courses Plus Student 11,819 Points

Why do you need to wrap the Application function in < /> tags?

I understand that if you don't wrap the Application function in < /> tags it won't work but if you can enter JSX in the ReactDOM.render function and this returns what looks like JSX, why wouldn't just running the function work?

1 Answer

It's frustrating that this isn't explained. Obviously the < /> tags look like HTML, but this makes it apparent that they are functionally not HTML, even if they may used to render HTML. It appears to me that the tags are essentially an alternate constructor syntax.

This article helps some: https://medium.com/@joshblack/stateless-components-in-react-0-14-f9798f8b992d