Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import(/* webpackChunkName: "momentjs" */ "moment")
- .then(function (moment) {
- // lazyModule has all of the proper types, autocomplete works,
- // type checking works, code references work \o/
- var time = moment().format();
- console.log("TypeScript >= 2.4.0 Dynamic Import Expression:");
- console.log(time);
- _this.setState({ time: time });
- })
- .catch(function (err) {
- console.log("Failed to load moment", err);
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement