(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);
-
-
Save JimmyLv/2d9251e83aebdb85c6ffe99a20ba56d4 to your computer and use it in GitHub Desktop.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment