Created
September 7, 2019 16:32
-
-
Save adamdriscoll/8a997c9f269bfb6b35ea6c2564008513 to your computer and use it in GitHub Desktop.
Lazy Element componentWillMount function from Universal Dashboard
This file contains hidden or 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
componentWillMount() { | |
var script = document.createElement('script'); | |
script.onload = function() { | |
this.setState({loading:false}); | |
}.bind(this) | |
script.src = getApiPath() + "/" + this.props.component.assetId; | |
document.head.appendChild(script); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment