What am I doing wrong?
#ES5:
require(‘urlify’).create()
#ES6 Doesn’t work:
import {create} from ‘urlify’
#node #javascript
-
-
@yoshuawuyts Interestingly I’m not wanting to use urlify. It was just to test derived properties in#AmpersandJS State. But now I’m piqued. -
@gyaresu hah, yeah. Me too. Never used import / Object destructuring before so curious to know what's going on. - 2 more replies
New conversation -
-
-
@yoshuawuyts > import * as foo from 'urlify' 'use strict' > foo { create: [Function], default: { create: [Function] } } -
@gyaresu ... so `import {create}` should be right. Running latest babel? Can you verify object destructuring works for non-imports?
End of conversation
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.