├── README.md └── react-comment-component.js /README.md: -------------------------------------------------------------------------------- 1 | # React / JSX HTML Comments 2 | Enable HTML comments and conditional IE comments in React components and JSX using a [Web Component](https://developer.mozilla.org/en-US/docs/Web/Web_Components). 3 | 4 | This repository is intended to share a solution to include native HTML comments in React components and JSX. It uses a Web Component (W3C Custom Element) to transform text to a native HTML comment. 5 | 6 | The solution depends on [document.registerElement](https://developer.mozilla.org/en-US/docs/Web/API/Document/registerElement) that requires a polyfill for most browsers, e.g. [WebReflection/document-register-element](https://github.com/WebReflection/document-register-element). 7 | 8 | You can read more about Web Components at [www.webcomponents.org](http://webcomponents.org/) and [facebook.github.io/react/docs/webcomponents.html](https://facebook.github.io/react/docs/webcomponents.html). 9 | 10 | Include the following javascript in your application to enable the `` Web Component. 11 | 12 | ```javascript 13 | /** 14 | * Web Component 15 | * 16 | * @usage 17 | * Comment-text, e.g. [if lte IE 9]>