Created
February 25, 2019 14:27
-
-
Save goughjo02/b84ffd23d722a35b6895f0c2a9f6dd2e to your computer and use it in GitHub Desktop.
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"; | |
export default class LazilyLoadedCustomFeature extends Component { | |
state = { | |
content: null | |
}; | |
componentDidMount() { | |
import(pathtofile).then(e => { | |
this.setState({ content: e }); | |
}); | |
} | |
render() { | |
const { content } = this.state; | |
return content; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment