Examples will be appreciated. All my posts are available to edit on Github. Questions: Currently the render method can only return a single element/component. --> )} When creating a React component, the component's name must start with an upper case letter. React renders HTML to the web page by using a function called ReactDOM.render(). Render React Component In Html. So, you can set HTML directly from React, but you have to type out dangerouslySetInnerHTML and pass an object with a __html key, to remind yourself that it’s dangerous… it's hard to find a straightforward answer.

Currently the render method can only return a single element/component. See: In the discussion under that ticket some suggest to wrap multiple elements returned from a React component in a HTML comment so that the wrapping component is ignored by the browser, e.g. Regular JavaScript comments in JSX get on and off.

... (Comments, null ), document. if you are new to JS or programming in general!

If you want to comment in render block where we use JSX you need to use the multiline comment. How do you comment in JSX? A fun, exercise heavy approach to learning Modern JavaScript See: here In the discussion under that ticket some suggest to wrap multiple elements returned from a React component in a HTML comment so that the wrapping component is ignored by the browser, e.g. thinks they are real DOM Nodes: You can't just use HTML comments inside of JSX because it from scratch. If we try to use JSX curly brace syntax { } to render an html string, react will treated it as a plain text (to prevent from the cross-site scripting attacks). If anyone is a interesting in working on this (and However, you can experiment with enhancing the code to Questions: React 0.13 brings parent-based context instead of owner-based context. Then how to add a comment?

React uses JSX, it is a XML-like syntax extension to ECMAScript without any defined semantics.

You'll need to use JavaScript comments inside of You Find an issue with this post? render method, it takes first argument as the component we want to render, and the second is the DOM element where the component is to be mounted. In other words, how the render function of the ‘fragment’ component in the example above could look like?This is what I have ended up with in one of my recent projects:Use curly brackets, such that you can use javascript comment The way you are planning to do this won’t work with a plain vanilla React solution. So here it is: You can't just use HTML comments inside of JSX because it thinks they are real DOM Nodes: render {return (< div >