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 trialkaran Badhwar
Web Development Techdegree Graduate 18,135 PointsComponents without JSX
So how do I render the components, if I do not wanna use JSX.
ReactDOM.render(
<Header />,
document.getElementById('root')
);
So what would I put instead of <Header /> , If I am using the other Approach ?
2 Answers
Torben Korb
Front End Web Development Techdegree Graduate 91,433 PointsReactDOM.render(
React.createElement(Header, null),
document.getElementById("root")
);
See React docs: https://reactjs.org/docs/react-without-jsx.html
Or try Babel REPL: https://babeljs.io/repl to see the transformation of any JSX code
Hope this helps. Happy coding!
karan Badhwar
Web Development Techdegree Graduate 18,135 PointsThanks Torben Korb , for the reply it helped thanks again sir