Created
October 27, 2017 14:39
-
-
Save gaganjakhotiya/23d20dfe8232fc3b34c5fc986da51506 to your computer and use it in GitHub Desktop.
Render Lazy Widgets
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react' | |
import ReactDOM from 'react-dom' | |
import getLazyComponent from './getLazyComponent' | |
function renderWidget(domSelector, widgetName, props) { | |
ReactDOM.render( | |
React.createElement(getLazyComponent(widgetName, props)), | |
document.querySelector(domSelector) | |
) | |
} | |
window.renderWidget = renderWidget |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment