h2cConverts html tags with attribute 'data-h2c' into Jsx Components and will add required import statements as mentioned in the data-h2c attribute. This extension will be mostly useful for the company's or individuals who uses existing npm jsx components in their org or community while build their new web app. Release Notes1.1.0Support for converting html into jsx Component based on css-class mapping is added Create a Javascript file that returns an object inside immediately invoke function expression (IIFE) like below. In the returning js object, set the css-class as prop name and component details as value. Invoke command palette search "Preferences: Open Settings (UI)" Go to -> Choose Extensions -> h2c (Html to jsx Component) and Provide css-class-map Js file full path Them open js or jsx file which has html tags pasted in render method, then invoke command palette, and search & select 'Convert Html to jsx Component' and see the magic supported component defining structures are string and object
1.0.0Initial release of h2c Structure of data-h2c attribute
NOTE:
Add 'data-h2c' attribute to the child html tags that need to be persevered when replacing the parent html tag with JSX component, by default the html tag will be preserved if its containing a child with data-h2c Example Input
Converting html into jxs Components H2C: After installing the H2C extension, open js or jsx file which has html tags pasted in render method, then invoke command palette, and search & select 'Convert Html to jsx Component based on H2c Prop' and see the magic. Example Output
|