(function ($, HtmlToReact, SGReact) {
$(function() {
var HtmlToReactParser = HtmlToReact.Parser;
var htmlToReactParser = new HtmlToReactParser();
$(".carousel-container").map(function() {
var reactComponents = [];
$(this).children().each(function() {
var htmlInput = this.outerHTML;
var reactComponent = htmlToReactParser.parse(htmlInput);
reactComponents.push(reactComponent);
});
// Empty the all the content inside the container
$(this).empty();
// Start to display the container
$(this).show();
var reactContainer = $(this)[0];
ReactDOM.render(
React.createElement(SGReact.Carousel, {}, reactComponents),
reactContainer
);
});
});
})(jQuery, HtmlToReact, SGReact);
/HTML React AEM.md Secret
Created
January 26, 2017 08:35
Star
You must be signed in to star a gist
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment